-
Notifications
You must be signed in to change notification settings - Fork 693
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type(docs): Update GraphQL document (support 3.11.0) #4791
base: master
Are you sure you want to change the base?
type(docs): Update GraphQL document (support 3.11.0) #4791
Conversation
ddbff2d
to
fdd26a6
Compare
71a102e
to
516f65c
Compare
Actually there is a thing I forgot to tell you guys. To create with the spactaQL tool, we need to change one of Query/Mutation/Subscriptions to parent type. Do you guys think this method seems fine? |
@suyeon-jung-dev Here are a couple of things we should add:
LMK if this sounds good? |
Hi, @neelanjan00 . If we need to add these two things, I'll look for other tools. Because SpectaQL doesn't support them.
Thank you for your feedback :) |
Can you please check if you can find any tool that can help us achieve this? This will be very useful! Thanks! |
Hi @neelanjan00 I looked into the two things you asked about earlier, but I couldn't find any tools that have all the features we need. 🥲 The tool we previously used, dociql, is no longer being updated — its last update was 2 years ago. Additionally, dociql can only be installed in a Python 2 environment. Even if we were to continue using it, we would still need to create a config.yaml file manually, which requires typing out every line. Regarding the feature "A window to try the API for a given server URL (similar to Swagger)," I have some concerns about potential security issues. We can also use GraphQL Playground for this purpose instead. Considering all of this, I think SpectaQL is the best option. |
2d168e9
to
45aff71
Compare
Okay sure, I guess we can just document the various success and failure cases for each API. We can skip the Swagger-like interface in favour of the in-built GraphQL playground. |
Hi @neelanjan00 , I tried to find many alternatives, but it seems unnecessary to create an error/success cases for every single request. (we already have success cases)
In the case of an error, it depends on implementing the resolver function (not schema), so we have to check it manually to add it to the API docs for the error case. (It's time time-consuming job and hard to maintain)
All GraphQL queries and mutations return errors in a structure like List. In our codebase, we only return a single error. It also differs only in the message part of the error and does not return any other metadata or data.
IMO, it would be much more efficient to add a page for common errors. This is because most errors coming from GraphQL servers are similar(authentication failure, MongoDB CRUD failure, etc.). SpectaQL supports adding pages using Markdown. So how about using this feature? |
Sounds good, this is what I meant as well actually, sorry for the confusion if any. Yes, having some sort of documentation around the success and most common failure messages for at least the most common mutations and queries will be a good way forward. |
Signed-off-by: Suyeon Jung <[email protected]>
Signed-off-by: Suyeon Jung <[email protected]>
Signed-off-by: Suyeon Jung <[email protected]>
Signed-off-by: Suyeon Jung <[email protected]>
a0bff0e
to
ab6dce3
Compare
I deployed a demo using the branch feature/update-api-docs-3.9.1-deploy-test on my repository. You can check 3.9.x, 3.10.x, 3.11.x version of GraphQL docs demo with those links. Finally, the changes I made include:
|
Signed-off-by: Suyeon Jung <[email protected]>
Signed-off-by: Suyeon Jung <[email protected]>
Signed-off-by: Suyeon Jung <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Proposed changes
This PR adds:
Solved #4771
GraphQL API docs demo v3.9.0: https://suyeon-jung-dev.github.io/litmus/graphql/v3.9.0/api.html
GraphQL API docs demo v3.10.0: https://suyeon-jung-dev.github.io/litmus/graphql/v3.10.0/api.html
GraphQL API docs demo v3.11.0: https://suyeon-jung-dev.github.io/litmus/graphql/v3.11.0/api.html
Types of changes
What types of changes does your code introduce to Litmus? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
Special notes for your reviewer: