0 I have created multiple graphqls files with multiple types but the Intellij will not recognize the types when used. !Important: No error was thrown at compile time and the queries works as expected but visually is very annoing to have everything in red In the next image you can see that i have the […]
0 I am trying to get superior id one by one from my database, but the last one will be allways nullable and i don´t know how to be able to ask in Int type varible for null value. I tried this query which function untill i use the null value. query GetSortHierarchy($device_id: Int!, $filter_id: […]
1 Say I have this GraphQL query: query GetUser($user_id: Int) { user(user_id: $user_id) { name } groups(user_id $user_id) { name } } This query recieves user id, and returns: user’s name names of all the groups this user belongs to I know that user should be defined in the SDL like this: type Query{ user(user_id: […]
0 I am currently implementing GraphQL into a system and am using Spring Boot 3.0.5 together with org.springframework.boot:spring-boot-starter-graphql to implement GraphQL schemas and queries. However there is a query that has issues. The relevant JPA entities: @Entity public class Video { @Id @Column(length = 24, nullable = false) private String videoId; @ManyToMany(mappedBy = "video") private […]
57 Although I copied and pasted the graphQL query from the GraphiQL tool after I tested it at GraphiQL successfully , the query returned with an error when I tried it in Apollo client within a reactJS app: [GraphQL error]: Message: Cannot query field “allStudents” on type “Query”., Location: [object Object], Path: undefined Here is […]
0 const claimableItemId = "5ab7c5ab-7a3d-4a92-a62f-2fbd995955f6"; const destAddr = "0x387961b46242A42B445D4354d5048329410613a7"; const [redeemEarnableItem, { data: redeemItem }] = useMutation( REDEEM_EARNABLE_ITEM, { variables: { claimableItemId, destAddr, }, } ); const [getInvoiceDetails, { loading, data: invoiceDetails, refetch }] = useQuery(GET_INVOICE_DETAILS); const redeemHandler = async () => { try { const redeemItem = await redeemEarnableItem(); const id = redeemItem.data.redeemEarnableItem.invoiceID; console.log(id, […]
0 Since I am new to GraphQL, I don’t really know how to call a REST Endpoint and query the fields accordingly. In particular, I want to fetch certain fields from the entire response of a GET API. What I have learnt is GraphQL sends a POST Request. How do I hit the GET endpoints […]
0 In my GraphQL API I have defined a course fragment with an array property lessons. Initially it only had lessons of type TextLesson. Later we added lessons of type VideoLesson as well. fragment TextLessonFields on TextLesson { title body } #fragment VideoLessonFields on VideoLesson { # title # videoUrl #} fragment CourseFields on Course […]
0 I am facing a problem with the following snippet: const [execute] = useLazyQuery(gql` query Example($id: String!) { node(id: $id) { … on Train { id passengers(first: 1) { totalCount } } } } `) useEffect(() => { execute({ onCompleted: () => console.log("Hello world") }) }, []) interface Node { id: ID! } type PassengerConnection […]
2 I need to use 2 queries in my file and I am writing them like so: const {loading, data } = useQuery(getCharactersQuery); const {loading, data} = useQuery(getSingleCharacterQuery); The problem is, they both have the same "loading" and "data" variables and I don’t see anywhere in the docs how can we have different ones. How […]