Yamashou / gqlgenc

This is Go library for building GraphQL client with gqlgen
MIT License
370 stars 66 forks source link

Errors parsing local schema file #236

Open KyleKotowick opened 1 month ago

KyleKotowick commented 1 month ago

I'm trying to build a client GraphQL library for the Shopify GraphQL API (schema attached below; had to add a .txt extension so it would allow me to upload).

schema.graphql

This schema was extracted from their API using the get-graphql-schema tool.

Here's the gqlgenc.yml file:

model:
  package: generated
  filename: ./models/models_gen.go
client:
  package: client
  filename: ./client.go
models:
  Int:
    model: github.com/99designs/gqlgen/graphql.Int64
  Date:
    model: github.com/99designs/gqlgen/graphql.Time
schema:
  - "./*.graphql"
generate:
  clientInterfaceName: "ShopifyGraphQLClient"
  structFieldsAlwaysPointers: true

When I run gqlgenc, I get the error:

failed to load schema: load local schema failed: loadLocalSchema: schema.graphql:1: Unexpected <Invalid>

The schema appears to be valid, not sure why it's throwing this error.

Yamashou commented 2 weeks ago

@KyleKotowick

I would like you to provide a minimal schema that will not cause an error if the path is explicitly specified.