Open
Description
Currently, using the same file and selected_operation
in the custom derive does not work.
The generated const QUERY = ""...
is the same string for all the generated modules, re-using the value of the first generated.
Eg:
mutation Login($account: String!, $user: String!, $password: String!) {
login(account: $account, user: $user, password: $password) {
account {
id
identifier
name
}
user {
id
username
email
}
token
}
}
mutation Signup($data: SignupInput!) {
signup(data: $data) {
account {
id
identifier
name
}
user {
id
username
email
}
token
}
}
mutation BookmarkCreate($url: String!, $title: String!, $description: String) {
bookmarkCreate(url: $url, title: $title, description: $description) {
...Bookmark
}
}
fragment Bookmark on Bookmark {
id
url
title
description
}
query Bookmarks {
bookmarks {
...Bookmark
}
}
mutation Login($account: String!, $user: String!, $password: String!) {
login(account: $account, user: $user, password: $password) {
account {
id
identifier
name
}
user {
id
username
email
}
token
}
}
mutation Signup($data: SignupInput!) {
signup(data: $data) {
account {
id
identifier
name
}
user {
id
username
email
}
token
}
}
mutation BookmarkCreate($url: String!, $title: String!, $description: String) {
bookmarkCreate(url: $url, title: $title, description: $description) {
...Bookmark
}
}
fragment Bookmark on Bookmark {
id
url
title
description
}
query Bookmarks {
bookmarks {
...Bookmark
}
}
Result:
mod login {
const QUERY: &'static str = "mutation Login ....";
}
mod signup {
// Query re-used !
const QUERY: &'statc str = "mutation Login...";
}