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

Usage with "GraphQL Code Generator" #47

Open
Alex-Ferreli opened this issue Sep 19, 2021 · 6 comments
Open

Usage with "GraphQL Code Generator" #47

Alex-Ferreli opened this issue Sep 19, 2021 · 6 comments

Comments

@Alex-Ferreli
Copy link

Hi, this plugin it's awesome! I'm able to get it working with @apollo/client with a custom ApolloLink as suggested in documentation.

It's also possible to make GraphQL Code Generator generate right types? I'm using it to generate Typescript types and React Hooks.

typescript-operations is the plugin that generate types, maybe should be possible to pass graphql-lodash custom directives and use them to generate right the types.

Some advice on how to do it?

@IvanGoncharov
Copy link
Member

@Alex-Ferreli This is an experimental plugin, so I don't expect tools like "GraphQL Code Generator" supporting.
Personally never used "GraphQL Code Generator" myself so can't offer help or advice.
I Will keep this issue open so maybe someone from the community can help you.

@M-Matin-dev
Copy link

It would be great to have this feature.

@hutber
Copy link

hutber commented Aug 16, 2022

Ye, code gen is so fantastic!!

I wonder what would be needed to get this plugin out of experimental and into "YE BOI!!"

@icdevin
Copy link

icdevin commented Nov 2, 2022

GraphQL Codegen allows you to specify a custom loader which returns the schema. You can extend the schema before returning it from the custom loader.

@Alex-Ferreli
Copy link
Author

GraphQL Codegen allows you to specify a custom loader which returns the schema. You can extend the schema before returning it from the custom loader.

I can't edit my schema, it's autogenerated (by Hasura in this case). How can i add those custom directives to an existing schema? Could you provide an example please?

@icdevin
Copy link

icdevin commented Nov 2, 2022

Hasura looks like it's just a server-side tool. If your UI is using a schema generated by the server, there must be some point of introspection on the UI side where you can extend the schema returned from the server.

I have no experience with different GraphQL tools, I just know the ones I used, but I expect it's at least somewhat similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants