graphql-rust / graphql-client

Typed, correct GraphQL requests and responses in Rust
Apache License 2.0
1.12k stars 152 forks source link

failed to parse schema #482

Open crazybits opened 2 months ago

crazybits commented 2 months ago

error is attached below, and the schema is downloaded with command graphql-client introspect-schema https://api.mainnet.aptoslabs.com/v1/graphql --output ./schema.graphql

[derive(GraphQLQuery)]

^^^^^^^^^^^^

= help: message: called Result::unwrap() on an Err value: GeneralError("Parser error: schema parse error: Parse error at 1:1\nUnexpected {[Punctuator]\nExpected schema, extend, scalar, type, interface, union, enum, input or directive\n")

tomhoule commented 2 months ago

Could it be that your schema is JSON, but with a .graphql extension?

In that case changing the extension (--output ./schema.json) should work.