atulmy/gql-query-builder

Mutation is working fine but when try to use query it does not returns the data instead shows api failure message.

Ppkd2021 opened this issue · 1 comments

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.

Not an issue.