Has anyone used the API from rust, e.g. using https://github.com/graphql-rust/graphql-client?

I’m having trouble at the first step. This library needs the schema available at compile time. I downloaded the schema and saved it to disk, it starts:

  "account_id": 6188811,
  "data": {
    "__schema": {
      "directives": [

… When I try to compile my project, it rejects the schema:

error: Failed to generate GraphQLQuery impl: Parser error: schema parse error: Parse error at 1:1
Unexpected `{[Punctuator]`
Expected `schema`, `extend`, `scalar`, `type`, `interface`, `union`, `enum`, `input` or `directive`

It looks like graphql_client is rejecting the schema right from the first {, so I’m wondering if anyone else has successfully accessed Monday from rust code.

And just to answer my own question: The schema had to have the correct extension. I had named it with a .graphql extension, but once i changed that to .json it worked.

1 Like