[GH-ISSUE #52] Mutation is working fine but when try to use query it does not returns the data instead shows api failure message. #32

Closed
opened 2026-03-03 00:02:52 +03:00 by kerem · 1 comment
Owner

Originally created by @Ppkd2021 on GitHub (Oct 17, 2020).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/52

Code : const getTopPostsByGroupIdQuery = query({
operation: getTopPostsByGroupId,
variables: {
groupId: {value: 3d42529f-e129-4e8f-87a8-e53a0a0fccbe, required: true},
postType: {value: Text, required: true},
limit: {value: 10, required: true},
startMonth: {value: 10, required: true},
endMonth: {value: 10, required: true},
startYear: {value: 2019, required: true},
endYear: {value: 2020, required: true}
},
fields: [activityRate, postCreatedAtUTC, commentCount]
cy.api({
method: POST,
url: appSyncUrl,
headers: {
authorization:noGroupAdminAuth
},
body: getTopPostsByGroupIdQuery
}).then(({body}) => {
const {
data: {getTopPostsByGroupId},
errors: [{errorType, message}]
} = body;
Can you please check if anything is missing in above code.

Originally created by @Ppkd2021 on GitHub (Oct 17, 2020). Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/52 Code : const getTopPostsByGroupIdQuery = query({ operation: `getTopPostsByGroupId`, variables: { groupId: {value: `3d42529f-e129-4e8f-87a8-e53a0a0fccbe`, required: true}, postType: {value: `Text`, required: true}, limit: {value: 10, required: true}, startMonth: {value: 10, required: true}, endMonth: {value: 10, required: true}, startYear: {value: 2019, required: true}, endYear: {value: 2020, required: true} }, fields: [`activityRate`, `postCreatedAtUTC`, `commentCount`] cy.api({ method: `POST`, url: appSyncUrl, headers: { authorization:noGroupAdminAuth }, body: getTopPostsByGroupIdQuery }).then(({body}) => { const { data: {getTopPostsByGroupId}, errors: [{errorType, message}] } = body; Can you please check if anything is missing in above code.
kerem closed this issue 2026-03-03 00:02:52 +03:00
Author
Owner

@Ppkd2021 commented on GitHub (Oct 17, 2020):

Not an issue.

<!-- gh-comment-id:710943073 --> @Ppkd2021 commented on GitHub (Oct 17, 2020): Not an issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gql-query-builder#32
No description provided.