graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

derive(GraphQLQuery) fails unknown reason with fragment

Open MPThLee opened this issue 6 years ago • 1 comments
trafficstars

query.graphql:

query Q {
  a {
    ...BFragment
  }
}

fragment BFragment on TypeOne {
  b {
    ...AFragment
  }
}

fragment AFragment on TypeTwo {
  c
}

schema.graphql:

type Query {
  a: [TypeOne]
}

type TypeOne {
  b: [TypeTwo]
}

type TypeTwo {
  c: Int!
}

during compiling:

   Compiling graphql_client v0.8.0 (<local_storage>\graphql-client\graphql_client)
error[E0412]: cannot find type `AFragment` in this scope
 --> graphql_client\tests\fragment_complex_chain.rs:4:10
  |
4 | #[derive(GraphQLQuery)]
  |          ^^^^^^^^^^^^ help: a struct with a similar name exists: `BFragment`

error: aborting due to previous error

Is this my mistake? The actual query that i've tried works on server side but not library. Maybe related to #286, The test on this issue was done on master branch(183489eb). and 0.8 shows same error.

MPThLee avatar Nov 12 '19 08:11 MPThLee

I still have this issue on the current latest graphql_client (0.9) :(.

Ten0 avatar Jun 17 '20 13:06 Ten0