Skip to content

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

Open
@tomhoule

Description

@tomhoule
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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions