-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
GraphQL (Docs): Document the /admin/schema/validate endpoint #6814
Conversation
Added documentation for the schema validation endpoint, per #6250 and https://dgraph.atlassian.net/browse/GRAPHQL-780
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.
Suggested some minor wording changes and a few spelling mistakes.
after those are addressed.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on @aaroncarey, @abhimanyusinghgaur, @bucanero, @danielmai, and @MichaelJCompton)
wiki/content/graphql/admin/index.md, line 348 at r1 (raw file):
defnition
definition
wiki/content/graphql/admin/index.md, line 349 at r1 (raw file):
Quoted 4 lines of code…
You can validate a GraphQL schema before adding it to your database by sending your schema defnition to the `/admin/schema/validate` endpoint, as in the following HTTP request example: Request header:
___
*[wiki/content/graphql/admin/index.md, line 356 at r1](https://reviewable.io/reviews/dgraph-io/dgraph/6814#-MKsHv9l7raSs4q7O4ct:-MKsHv9l7raSs4q7O4cu:b-xhq5wc) ([raw file](https://github.com/dgraph-io/dgraph/blob/a179e80d05cb1fac6e0c0e854f74cc2e7ac56951/wiki/content/graphql/admin/index.md#L356)):*
> ```
> content-type: application/json
> ```
This header is not required in the HTTP request. The input is just plain text.
The HTTP response is JSON.
___
*[wiki/content/graphql/admin/index.md, line 368 at r1](https://reviewable.io/reviews/dgraph-io/dgraph/6814#-MKsIm-D9PH_Vi3kk-5S:-MKsIm-D9PH_Vi3kk-5T:b-k00oht) ([raw file](https://github.com/dgraph-io/dgraph/blob/a179e80d05cb1fac6e0c0e854f74cc2e7ac56951/wiki/content/graphql/admin/index.md#L368)):*
> ```
> and
> ```
an
<!-- Sent from Reviewable.io -->
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.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on @aaroncarey, @abhimanyusinghgaur, @bucanero, @danielmai, and @MichaelJCompton)
Incorporate feedback from Abhimanyu's review
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.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on @abhimanyusinghgaur, @bucanero, @danielmai, and @MichaelJCompton)
wiki/content/graphql/admin/index.md, line 348 at r1 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
defnition
definition
Done. Sorry that I missed that!
wiki/content/graphql/admin/index.md, line 349 at r1 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
You can validate a GraphQL schema before adding it to your database by sending your schema defnition to the `/admin/schema/validate` endpoint, as in the following HTTP request example: Request header: ```ssh path: /admin/schema/validate method: POST content-type: application/json
Request body:
Should we phrase it like this:
You can validate a GraphQL schema before adding it to your database by sending your schema definition in an HTTP POST request to the `/admin/schema/validate` endpoint, with the following body:
Thanks for this suggestion! I picked up some of this phrasing, but I wanted to retain the word "example" and also provide the example header that includes the content-type
, as including that in the sentence made it too long.
wiki/content/graphql/admin/index.md, line 356 at r1 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
content-type: application/json
This header is not required in the HTTP request. The input is just plain text.
The HTTP response is JSON.
Thanks for the clarification! Fixed.
wiki/content/graphql/admin/index.md, line 368 at r1 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
and
an
Done.
This endpoint returns a JSON response that indicates if the schema is valid or | ||
not, and provides an error if isn't valid. In this case, the schema is valid, | ||
so the JSON response includes the following message: `Schema is valid`. | ||
|
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.
if you want, we could also add a curl
example, like:
curl -X POST localhost:8080/admin/schema/validate --data-binary '@schema.graphql'
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
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.
Thanks!
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on @aaroncarey, @abhimanyusinghgaur, @danielmai, and @MichaelJCompton)
Added documentation for the schema validation endpoint, per #6250 and GRAPHQL-578.
Fixes GRAPHQL-780
This change is
Docs Preview: