Skip to content

Commit 96263b8

Browse files
committed
WIP - Let users add arbitrary derives to ResponseData
1 parent 4a0eb43 commit 96263b8

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

tests/more_derives.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#[derive(GraphQLQuery)]
2+
#[graphql(
3+
schema_path = "tests/more_derives/schema.graphql",
4+
query_path = "tests/more_derives/query.graphql",
5+
response_derives = [PartialEq, PartialOrd],
6+
)]
7+
struct MoreDerives;
8+
9+
#[test]
10+
fn response_derives_can_be_added() {
11+
let response_data = more_derives::ResponseData {
12+
current_user: Some(more_derives.:TestUser {
13+
id: "abcd",
14+
name: "Angela Merkel"
15+
})
16+
};
17+
}

tests/more_derives/query.graphql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
query Test {
2+
currentUser {
3+
name
4+
id
5+
}
6+
}

tests/more_derives/schema.graphql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
schema {
2+
query: TestQuery
3+
}
4+
5+
type TestQuery {
6+
currentUser: TestUser
7+
}
8+
9+
type TestUser {
10+
name: String
11+
id: ID
12+
}

0 commit comments

Comments
 (0)