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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): Add schema customization docs #13832

Merged
merged 19 commits into from
May 23, 2019

Conversation

stefanprobst
Copy link
Contributor

@stefanprobst stefanprobst commented May 3, 2019

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.

@stefanprobst stefanprobst requested a review from a team May 3, 2019 09:46
@stefanprobst stefanprobst requested a review from a team as a code owner May 3, 2019 09:46
Copy link
Contributor

@m-allanson m-allanson left a 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 :bowtie:

```

Gatsby Type Builders allow referencing types as simple strings, and accept full
field configs ('type', 'args', 'resolve').
Copy link
Contributor

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?

Copy link
Contributor Author

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 muescha closed this May 3, 2019
@stefanprobst
Copy link
Contributor Author

@muescha why did you close this?

@stefanprobst stefanprobst reopened this May 3, 2019
Copy link
Contributor

@muescha muescha left a 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

@LekoArts
Copy link
Contributor

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):

@stefanprobst stefanprobst added type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed status: WIP labels May 17, 2019
Copy link
Contributor

@marcysutton marcysutton left a 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!

@LekoArts
Copy link
Contributor

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.

@freiksenet
Copy link
Contributor

freiksenet commented May 21, 2019

@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.

@freiksenet freiksenet changed the title [WIP] Add schema customization docs feat(docs): Add schema customization docs May 21, 2019
@freiksenet freiksenet requested a review from marcysutton May 21, 2019 14:00
@marcysutton
Copy link
Contributor

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.

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.

@freiksenet freiksenet merged commit 4b2998b into gatsbyjs:master May 23, 2019
@stefanprobst stefanprobst deleted the schema-customization-guide branch July 8, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants