0
here is my query:
export const projectsQuery = `
query getProjects($category: String!, $endcursor: String!) {
projectSearch(first: 8, after: $endcursor, filter: {category: {eq: $category}}) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
title
githubUrl
description
liveSiteUrl
id
image
category
createdBy {
id
email
name
avatarUrl
}
}
}
}
}
`;
and the error: generates:
Unhandled Runtime Error
Error: Variable endcursor is not defined.: {"response":{"data":null,"errors":[{"message":"Variable endcursor is not defined.","locations":[{"line":3,"column":5}],"path":["projectSearch"]}],"status":200,"headers":{}},"request":{"query":"n query getProjects($category: String!, $endcursor: String!) {n projectSearch(first: 8, after: $endcursor, filter: {category: {eq: $category}}) {n pageInfo {n hasNextPagen hasPreviousPagen startCursorn endCursorn }n edges {n node {n titlen githubUrln descriptionn liveSiteUrln idn imagen categoryn createdBy {n idn emailn namen avatarUrln }n }n }n }n }n","variables":{}}}
if you know , plz let me know
But if I gave type name without " !" means "String" instead of "String !" then it works, but it creates the problem on production side
2
1 Answer
Reset to default
-1
I have the same issue with query, did you solve this problem?
1
-
This does not provide an answer to the question. You can search for similar questions, or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, ask a new question, and include a link to this one to help provide context. See: Ask questions, get answers, no distractions
– Natty57 mins ago
Probably because you are not actually passing a value for
$endcursor
inside your request. Henceforth when you type the parameterString!
the error is thrown and otherwise it is not.Jul 18 at 14:18
Please show the code where you are executing the query and providing it with variables. Presumably you are passing in
category
somewhere because that's also a required variable.Jul 18 at 19:26