-
Notifications
You must be signed in to change notification settings - Fork 20
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
Export TypedDocumentString #163
Comments
I have been going down a similar rabbit hole around string-based APIs and standardised types for them (the same octokit issue, in fact!) I glanced through the original graphql-codegen PR for TypedDocumentString. The decision to inline the type in the output, instead of referencing it from to the core types, seems incidental or at least there was no motivation for it at the time (which is fine 😌). Having a standard type for string-based libraries (similar to what I have a hunch that we could/should also raise this issue in the graphql-code-generator repository, since that is what would insert the call-sites for this type, and might have more context about its desired shape. Edit: upon further inspection, It's probably still good to expose a common |
In Graffle I built its own internal typed document abstraction that sons all three cases: graphql package typed document query, this typed document node, and the typed document string. If there's interest I may open source it after Graffle is released. It's not much code, it could easily be contributed back also to Guild repos. |
Right now, if we use
documentMode: 'string'
thegraphql-codegen
tool will generate a definition for aTypedDocumentString
type into our project. That makes it hard to name the same type from a library like https://github.com/octokit/graphql.js that wants to pass a string through instead of parsing it to a DocumentNode first. It's not obvious that this is the right home for that type, but it seems like the closest existing library.The text was updated successfully, but these errors were encountered: