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

(derive) Improve the error messages when a required attribute is missing

Open tomhoule opened this issue 6 years ago • 1 comments

error: proc-macro derive panicked
  --> src/lib.rs:14:10
   |
14 | #[derive(GraphQLQuery)]
   |          ^^^^^^^^^^^^
   |
   = help: message: Extracting query path.
           The graphql attribute is missing
error: proc-macro derive panicked
  --> src/lib.rs:14:10
   |
14 | #[derive(GraphQLQuery)]
   |          ^^^^^^^^^^^^
   |
   = help: message: Extracting schema path.
           attribute not found

The message should give an example of what is expected, e.g.

#[derive(GraphQLQuery)]
#[graphql(query_path = "src/Bookings.graphql", schema_path = "schema.json")]
struct Bookings;

tomhoule avatar Jun 13 '19 16:06 tomhoule

I have same error

AiFreeWay avatar Jun 14 '19 09:06 AiFreeWay