-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Description
I have the following query, and some troubles to mock it. (using v 3.0.6)
query trialQuery {
viewer {
name
isHireable
repository(name: "test") {
issues(first: 5, orderBy: {field: CREATED_AT, direction: DESC}) {
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
totalCount
edges {
node {
id
title
viewerDidAuthor
state
}
}
}
}
}
licenses {
name
}
}
`;Situation:
- without
licensespart, it is possible to mock it (removing the "viewer"), e.g.:
{
isHireable: false,
name: 'martin',
repository: {
issues: {
pageInfo: {
hasPreviousPage: false,
hasNextPage: true,
startCursor:
'Y3Vyc29yOnYyOpK5MjAxOS0wMS0xNFQxMDowNTo0NSswMTowMM4XxS65',
endCursor: 'Y3Vyc29yOnYyOpK5MjAxOS0wMS0xNFQxMDowNDo0MyswMTowMM4XxS1p',
},
totalCount: 25,
edges: [
{
node: {
id: 'MDU6SXNzdWUzOTg3OTg1MjE=',
title: 'test 25',
viewerDidAuthor: true,
state: 'OPEN',
},
},
...- I would like to have
viewer, as it is more semantic, but especially it is necessary if we want to query multiple resources at once, in the example above, no way to mocklicenses.
One more thing, if I try to define variables (global), I get an error:
query trialQuery($repo: String!, $count: Int, $orderBy: IssueOrder) {
viewer {
name
isHireable
repository(name: $repo) {
issues(first: $count, orderBy: $orderBy) {
...Error: repo variable is not defined on viewer arguments
@estrada9166 Could you please give me some hint?
Metadata
Metadata
Assignees
Labels
No labels