-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(docs): Add schema customization docs #13832
feat(docs): Add schema customization docs #13832
Conversation
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.
Wow this is really great! Very clear and comprehensive. I've ignored your [WIP] label and added a few comments, I hope that's ok
docs/docs/schema-customization.md
Outdated
``` | ||
|
||
Gatsby Type Builders allow referencing types as simple strings, and accept full | ||
field configs ('type', 'args', 'resolve'). |
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.
Could this link to some external docs on field configs?
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.
Good idea! Not sure where to link though? To graphql-js
docs (which is not 100% the same syntax), or graphql-compose
docs (which is the better option, but we don't mention it anywhere else in the docs, so might be confusing?
@muescha why did you close this? |
Co-Authored-By: stefanprobst <[email protected]>
Co-Authored-By: stefanprobst <[email protected]>
Co-Authored-By: stefanprobst <[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.
@stefanprobst sorry - i was not aware that i clicked on some close issue button - sorry
here my nitpicks
Co-Authored-By: stefanprobst <[email protected]>
Co-Authored-By: stefanprobst <[email protected]>
Co-Authored-By: stefanprobst <[email protected]>
Co-Authored-By: stefanprobst <[email protected]>
Things people regularly want to do (looking at Reddit, Issues, Spectrum, Discord etc.) and should definitely be in here with fitting headings (for search and SEO):
|
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.
Great piece! I added some suggestions for wording adjustments, and heading level changes. Thanks for putting this together!
Co-Authored-By: Marcy Sutton <[email protected]>
Another idea/request: One defines an ID in the frontmatter of markdown files and Gatsby will pass that onto the source plugin so that it can fetch that data. Usecase: Pulling all data from TMDB and then mapping/filtering for that ID takes way too much time. The source plugin then should query the individual endpoint with the ID on demand so that the schema in the end only has data for these IDs from the frontmatter. Currently you'd have to know which data to fetch from the API to be able to query it. |
@marcysutton I'm not sure what exactly we can add to conclusion, I feel the guide kinda covers too much and that's it's such a wall of text :( I feel we could improve this doc by splitting it into "guide" and "cookbook" sections. Guide would be like a tutorial to defining your types and cookbook will have more advanced solution covered. I'd rather have that in a separate PR though, because I feel this doc is super valuable to have (so we can refer people to it). So let's merge it and I'll split it in a follow up PR. |
Agreed that is fine for a separate PR! We would like to add GraphQL recipes, and I could see schema customization recipes being useful too. My only outstanding request for this PR is to link to Github issues for updating the docs, so people know those needs exist when browsing Github. It would help to add some high-level details of what needs to be updated, too, to point them in the right direction. |
This adds a guide for the schema customization APIs. It would probably benefit from having a couple more concrete usecases, but it's a start.