graphql-rust / graphql-parser

A graphql query language and schema definition language parser and formatter for rust
Apache License 2.0
351 stars 74 forks source link

Support for interface implementing another interface doesn't seem to work. #64

Closed ehiggs closed 2 years ago

ehiggs commented 2 years ago

49 implemented interfaces that implement other interfaces for #44. However, when I try to use this in the wild, it doesn't seem to work.

Example:

This doesn't seem to work in the wild.

e.g.

query.graphl:

query FooList(bazId: ID!) {
  baz
}

schema.graphql:

interface Foo {
  foo: Int
}

interface Bar implements Foo {
  bar: Int
}

type Baz implements Bar {
  baz: ID!
}
$ graphql-client generate query.graphql --schema-path schema.graphql 
Error: Error generating module code: Parser error: schema parse error: Parse error at 5:15
Unexpected `implements[Name]`
Expected `end of input`

Location: /home/ehiggs/.cargo/registry/src/github.com-1ecc6299db9ec823/graphql_client_cli-0.10.0/src/generate.rs:75:24

I've run into this in the wild when dealing with Atlassian's (experimental) Jira Graphql schema derived using python's gql:

gql-cli https://jdog.atlassian.net/gateway/api/graphql --print-schema
ehiggs commented 2 years ago

It seems I didn't check the main branch correctly and 0.10.0 was released before the functionality was merged. When is g-c 0.11.0 due? Thanks!