Questions

  • Unexpected error object with mock-service-worker and react-query with graphql

    0 I’m writing a test where I expect an error message to show. This is the component I’m testing: export const CourseOverview = () => { const { data, isError, error, isSuccess } = useGetCourses(); if (isError) { return <div>{error.message}</div>; } if (isSuccess) { return ( <CourseAccordion items={data.courses} /> ); } return <div>Loading…</div>; }; useGetCourses […]

  • Proceesing 2 queries graphql response that have same type into array

    0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply { […]

  • WPGraphQL – How to fetch data based on a Where attribute?

    0 I have created a post type called LearnArticles in wordpress and another post type Learn Categories. Now I have linked both of them and I can access the Learn Categories data under the Learn Articles. But when I am trying to fetch data of a particular category I am unable to find the Learn […]

  • Proceesing 2 queries apollo graphql that have same type into 1 array

    0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply { […]

  • Mocking and unit testing graphql-dotnet

    0 I’m using graphql-dotnet library to query some GraphQL APIs from my C# code. Is there a way to easily mock the GraphQLHttpClient in unit tests? c# unit-testing graphql moq graphql-dotnet Share Follow asked 1 hour ago Dawid RutkowskiDawid Rutkowski 2,66711 gold badge3030 silver badges3737 bronze badges 2 what did you try yourself? – MakePeaceGreatAgain 42 […]

  • Shopify GraphQL “cartLinesAdd” API

    1 When I hit this Shopify GraphQL "cartLinesAdd" API to add product to my shopping cart, in response it says invalid ID. So, can anyone please help me to find out what’s wrong here? graphql postman shopify storefront Share Follow asked Sep 8, 2021 at 14:43 Prãshant SaraswatPrãshant Saraswat 33622 silver badges1414 bronze badges 1 […]

  • What does GraphQL do that REST can’t do?

    -3 I’ve been seeing that GraphQL allows the user to limit the data they receive, but that can be quite easily done on a REST API. You can have a, for example, /users endpoint that takes a query array in the request body, that limits the columns returned from the server. Or is there something […]

  • Strange behaviors of Extend in Typescript

    6 I am currentlu working with the Effect Ts lib. In it I saw something I don’t understand: export declare const typeSymbol: unique symbol export type typeSymbol = typeof typeSymbol type FilterIn<A> = A extends any ? typeSymbol extends keyof A ? A : never : never type FilterOut<A> = A extends any ? typeSymbol […]

  • How to set initialState using Redux Toolkit with data using Apollo’s useQuery?

    0 I am trying to call the useQuery hook (something not allowed outside of functional components), in a redux toolkit slice. Is this something that is doable, perhaps using createAsyncThunk or some similar method? My application is built with the MERN stack, so my database is MongoDB, and I’m using Graphql to fetch the data. […]

  • GraphQL iOS Apollo Client Automatic Persisted Queries Causing a Crash

    1 Looking to get some help with setup of APQ’s on the iOS Apollo SDK, using version of Apollo 1.2.2 and when turned on the APQ as: let transport = RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: url, autoPersistQueries: true) Getting an error on query fetch as: Apollo/RequestBodyCreator.swift:47: Fatal error: To enable autoPersistQueries, Apollo types must be generated with […]