Zaid-Ajaj / Snowflaqe

A dotnet CLI to generate type-safe GraphQL clients for F# and Fable with automatic deserialization, static query verification and type checking
MIT License
154 stars 25 forks source link

Why a GraphQL endpoint rather than a schema file? #2

Closed njlr closed 4 years ago

njlr commented 4 years ago

Why does the tool require a running endpoint or the output of the introspection query?

Wouldn't the GraphQL schema be enough?

This would make the build process simpler.

Zaid-Ajaj commented 4 years ago

Why does the tool require a running endpoint or the output of the introspection query?

Because a lot of the times you don't have control of the schema and you only have a running GraphQL backend

Wouldn't the GraphQL schema be enough?

Actually, if you have you a schema file definition, then that can be your input for the schema configuration. Just put the schema definition in a file with a .gql or .graphql extension and point the schema config to that file:

{
   "schema": "./schema-definition.gql" 
}  

Maybe I forgot to actually document that part 🤔

njlr commented 4 years ago

Makes sense!

PR for the docs: https://github.com/Zaid-Ajaj/Snowflaqe/pull/5

Zaid-Ajaj commented 4 years ago

Fixed and the docs are now in the README