-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Ensure a consistent schema for gatsby-plugin-documentationjs and add TypeScript support #13692
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
Ensure a consistent schema for gatsby-plugin-documentationjs and add TypeScript support #13692
Conversation
This is awesome. I'll test it with Gatsby docs website. |
type: DoctrineType | ||
default: JSON | ||
augments: [DocumentationJs] | ||
examples: [JSON] |
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.
This (and other JSON
fields in DoctrineType
) do change schema that will be generated (which is not a blocker - just wanted to mentioned that we would need to bump major as this will be breaking change)
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 feel that if shape of those types is defineable, it should be fully typed. JSON type should only be used in cases where shape of data is impossible to define.
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.
Examples probably can, but I specifically made the ones in DoctrineType JSON because they can be circularly typed, and therefore impossible to query with 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.
Thank you!
Holy buckets, @devongovett — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Published as |
I think we still need to do some work here -
^10.1.0 (to actually support Typescript - according to https://github.com/documentationjs/documentation/blob/master/CHANGELOG.md )
|
Oops, yes. 🤦♂️ will make another pr |
Followup to gatsbyjs#13692. This actually adds typescript support.
This adds a schema definition for gatsby-plugin-documentationjs to ensure that it is consistent no matter what files are actually processed. Currently, with gatsby's automatic schema generation, the schema can be missing fields if they are unused by the code that is being parsed and therefore the query would have to change as the code changes. This ensures that the schema will have all fields available no matter what.
Also, TypeScript support was recently added to documentationjs, so this enables
.ts
and.tsx
files to be processed as well.