graphql-static-binding
graphql-static-binding copied to clipboard
(Optionally) include typeDefs in generated .ts (.js) file
I'd like to use my own bindings in the browser, but the typeDefs aren't available (fs.readFile
). A solution is to import the typeDefs separately (fetch
in the browser). But I'd prefer to have the typedefs available in the generated .ts
file, like Prisma does.
Could this be included in the default generator? (binding-ts
) .
(Or maybe have this available as option for the default generator)
I like the idea, but I'd like to get some more feedback on this. Including typeDefs by default for a large schema will significantly increase file size. On the other hand, you'll need the schema anyway, so it might just as well be in that file.
Re configuration option. I currently don't see other cases for providing configuration options, so I don't want to do that right now. The issue being that such options will bubble up all the way to either graphql prepare
command line options, or additional graphql-config
extension options.
I agree that configuration option for this might be an overkill 👍 If default including is not desired, we could also make a binding-typedefs-ts
. But I think that default including is better.