is there an easy way to take a schema defined in S...
# orm-help
k
is there an easy way to take a schema defined in SDL and convert it to a .js file? I know the graphql-cli can do it, but seems like only via an introspection query to a running server. Any way to do it based on just the SDL?
n
the schema generation workflow of
graphql-cli
has two steps: 1.
graphql get-schema
- this is essentially the introspection against a running server 2.
graphql codegen
- this needs a
.graphql
file as input, and doesn't require a running server.
👍 1
k
thanks! maybe it’d help if I explain what I’m after… I’m experimenting with the codgen via graphql-binding. the “input” argument for that command needs to be .js file. How do I get a JS file using just an SDL?
n
How do I get a JS file using just an SDL?
I just lined that out above - or maybe I am misunderstanding something? 🙂
this takes the
.graphql
file and generates the
.ts
file
I think
input
should also offer
.graphql
files in the future to make this easier. Can you provide a feature request here: https://github.com/graphql-cli/graphql-cli? 🙂
k
so, i’m experimenting with the graphql-binding, and it seems like it has to have a .js file to do anything
n
Ahh I see! Sorry I've been misreading 🙂 Then https://github.com/graphql-binding/graphql-binding/issues is the appropriate repository to bring this up. We should definitely enable the
.graphql
workflow.
k
okay, i’ll add a request there. In the meantime, and suggestions about how I could work-around it manually?
n
I think you can use
graphql codegen
and the right
.graphqlconfig.yml
setup to get where you want, but I am not sure 🙂