Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

(Optionally) include typeDefs in generated .ts (.js) file #48

Open
Fonz001 opened this issue Jan 31, 2018 · 2 comments
Open

(Optionally) include typeDefs in generated .ts (.js) file #48

Fonz001 opened this issue Jan 31, 2018 · 2 comments

Comments

@Fonz001
Copy link

Fonz001 commented Jan 31, 2018

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)

@kbrandwijk
Copy link
Contributor

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.

@Fonz001
Copy link
Author

Fonz001 commented Jan 31, 2018

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.

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

No branches or pull requests

2 participants