-
Notifications
You must be signed in to change notification settings - Fork 15
Northwind API how to #274
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
Northwind API how to #274
Conversation
Co-authored-by: Michael Webb <[email protected]>
|
This PR includes documentation updates New pages: Updated pages: |
|
|
||
| [source, javascript, indent=0] | ||
| ---- | ||
| // JavaScript example |
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.
tba
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.
I think this is out of scope. We don't want to try to provide code for a full shopping basket.
|
|
||
| The product of `quantity` and `unitPrice` is the total cost, which in this case is 116.25. | ||
|
|
||
| // maybe add another JavaScript example here, that accesses the JSON response and actually calculates the amount. This could also be made generic, so that it is not reliant on the orderID used here. |
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.
tba
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.
I also think providing a code example here for calculating the result is out of scope.
modules/ROOT/content-nav.adoc
Outdated
| * *How-To* | ||
| * xref:driver-configuration.adoc[] | ||
| * xref:northwind-api.adoc[] |
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.
Let's change the name of the page to something else
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.
how about "graphql-modeling.adoc" ?
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.
That sounds nice to me!
angrykoala
left a comment
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.
Looks good to me, once the missing examples and other comments have been solved
|
Added some suggestions but nothing blocking. |
| mutation { | ||
| createCustomers( | ||
| input: [ | ||
| { | ||
| contactName: "Jane Doe" | ||
| } | ||
| ] | ||
| ) { | ||
| customers { | ||
| contactName | ||
| } | ||
| } | ||
| } | ||
| ---- | ||
|
|
||
| To make it generic, you can use a link:https://graphql.org/learn/queries/#variables[GraphQL variable] to set the contactName dynamically: | ||
|
|
||
| [source, javascript, indent=0] | ||
| ---- | ||
| mutation CreateCustomer($contactName: String!) { | ||
| createCustomers(input: [{ contactName: $contactName }]) { | ||
| customers { | ||
| contactName | ||
| customerID | ||
| } | ||
| } | ||
| } |
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.
Just a thought but the formatting/indentation/new lines of these should probably match
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.
tried to make it uniform
mjfwebb
left a comment
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.
<3
this is missing JavaScript examples for processing query data.
i tried, but it wasn't straight-forward to set up something locally (because of the CORS policy) and i got stuck setting up an apache server. at that point i decided to rather ask for help, because my JavaScript certainly would have been lacking anyway ;)