Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add graphql endpoint for publishing entries #132

Merged
merged 29 commits into from
May 20, 2022
Merged

Conversation

cafca
Copy link
Member

@cafca cafca commented May 19, 2022

Reopened from #128 (which was closed by buggy Github).

Closes #60

Todo

  • Implement endpoint
  • Happy path test
  • Sad path test

馃搵 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@cafca cafca marked this pull request as ready for review May 19, 2022 15:07
@cafca cafca requested a review from sandreae May 19, 2022 15:07
Copy link
Member

@sandreae sandreae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks 馃憤

I just had one question because I don't know GQL at all, but I'm happy for this to merge.

Comment on lines +79 to +87
let query = r#"
mutation TestPublishEntry($entryEncoded: String!, $operationEncoded: String!) {
publishEntry(entryEncoded: $entryEncoded, operationEncoded: $operationEncoded) {
logId,
seqNum,
backlink,
skiplink
}
}"#;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just me not knowing anything about GraphQL, but where does this TestPublishEntry come from? Or rather, what is it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this is also new to me! We have been using the shorthand syntax so far but usually I think you give a name to requests you can make multiple requests to the same endpoint with one query.

https://graphql.org/learn/queries/#operation-name

@cafca cafca merged commit 1a6b9a9 into development May 20, 2022
@cafca cafca deleted the graphql-publish-entry branch May 20, 2022 13:30
@adzialocha adzialocha linked an issue May 29, 2022 that may be closed by this pull request
@cafca cafca restored the graphql-publish-entry branch June 1, 2022 18:30
@adzialocha adzialocha deleted the graphql-publish-entry branch June 29, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace JSON RPC with GraphQL API queries and mutations
2 participants