Questions tagged [graphql]
GraphQL is an API technology designed to describe the complex, nested data dependencies of modern web applications. It is often considered an alternative to SOAP or REST
20,973
questions
0
votes
0
answers
16
views
Apollo Client GraphQL error is lost / undefined after second time loading the page (refreshing the browser)
I am using Apollo Client in my Astro project.
I have the following GraphQL query:
const { data, loading, errors } = await client.query({
query: GET_PAGE,
variables: {
url: uri,
},
...
1
vote
0
answers
6
views
Track upload progress in graphl mutation
I am uploading image to server from front-end by running the graphql mutation. What i wanr is that how should get response that what percentage of image size has uploaded to the server. For example if ...
0
votes
1
answer
13
views
Want an urdu title in shopify admin graphql query
I want to support multiple languages:
{
products(first:10,) {
edges {
node {
title
# Include other fields to retrieve within translations
}
}
}
}...
1
vote
0
answers
8
views
Mutation Chaining in apollo superGraph
I need to insert record in through one SubGraph and based on returned Id I want to update record in another SubGraph. Looks like apollo doesn't support mutation chaining directly (can't pass Id from ...
0
votes
1
answer
35
views
Implementing Middleware to Retrieve JWT Tokens from Header in a GraphQL Server with Node.js and Apollo
I'm trying to create a middleware to receive a token from the header, but it never seems to trigger, and I never see the 'hello' log message I inserted at the top of the middleware.
const jwt = ...
0
votes
1
answer
37
views
How can spring-boot application easily get data from external GraphQL service?
Background
My spring-boot-3 application need to get data from external GraphQL API. There I can/need fetch data by 4 different queries. I want to find some generic GraphQL Client with default GraphQL ...
0
votes
0
answers
24
views
Nextjs 14 and @apollo/experimental-nextjs-app-support/ssr overlapping query issue
I am using next.js 14 and apollo experimental lib, i am using suspense with useSuspenseQuery, when i reload page it always fire query in browser side even if query run on server also.
https://prnt.sc/...
0
votes
1
answer
36
views
Circular modules: Expected {} to be a GraphQL type
I came across this issue called module cycles when requiring modules.
Im working on a small star wars graphql api and ill explain in short where i got the issue :
I have two type : filmType and ...
-1
votes
1
answer
15
views
Handling error in apollo graphql returns invalid doctype even when content type is json
I have tried sending 404 status using json-server and it works with postman as seen below.
But when I'm doing it inside apollo sandbox, it's giving me this invalid doctype. Not sure why json-server ...
0
votes
1
answer
19
views
@apollo/client local-only field is not resolved when working with service worker
I have problems getting local-only fields via typePolicies to work in my app. My setup is the following:
This is one of my queries:
export const GET_ALL_DEBT_TOKENS = gql`
query GetDebtTokens {
...
0
votes
0
answers
17
views
ASP.NET Core and GraphQl problem with JWT Authentication
I am building an ASP.NET Core Web API with GraphQl, but I am facing issues with JWT token authentication. When the user is logged in I am returning the token, but when I want to create a query or ...
0
votes
1
answer
24
views
Is there a more efficient way to call multiple apis using graphql and react
I am using GraphQL and react on my client side project but I am not using a state management system like Redux
I have organised my api calls into custom hook files like below
const [getSomeData, { ...
-1
votes
1
answer
33
views
415 status code from from simple graphql-http setup
I was scanning over the graphql docs to find express-graphql deprecated so I decided to implement the recommended graphql-html version:
this is my server.js:
import { createHandler } from "...
0
votes
0
answers
15
views
I can't read session when I pass from next-auth to nodejs
I have Next.js project where I use next-auth and I use node.js for the server. when user log in system, their session should pass to nodejs like this:
this code is part of [...nextAuth].ts
events: {
...
0
votes
0
answers
26
views
Get indexed objects with query, not just ids
Newby here with amplify and graphql. I am using amplify v6: https://docs.amplify.aws/react-native/build-a-backend/graphqlapi/data-modeling/ for react native. I was under the impression that graphql ...
0
votes
1
answer
20
views
useMutation does not work from react front end but works in apollo client with same variables Mutation.js
I am trying to executate a mutation called createGroup, when i do it graphQl apolo clients it creates the group in firebase collection successfully but in the react frontend it does not work. When the ...
-1
votes
1
answer
32
views
Example of a GraphQL query where there are multiple different filter types on a single record type depending where it is located int he query tree? [closed]
I am asking ChatGPT for help deep diving into GraphQL query possibilities, as I'm toying around with making a JSON variant of GraphQL for learning purposes. One thing I'm perplexed about and have been ...
0
votes
1
answer
22
views
How to update apollo cache
I am wondering why it's very hard to update a data inside of apollo client cache, comparing to similar libraries like react-query it's too complicated
For example, When I have a query with pagination (...
0
votes
0
answers
13
views
In graphql what is difference between a `type query` and `extend type query`?
In graphql what is difference between a type query and extend type query?
Ex: difference between
type Query {
product(id: String!): Product
}
and
extend type Query {
DeviceDetail(devId: ...
0
votes
0
answers
11
views
loading queries from .graphql files and use them with apollo client and react
Hi guys basicalle I'm creating an app using react, graphql and apollo client, currently I,m loading the queries from a .tsx file with this kind of structure
const MULTIPLE_WELLS_FROM_TAO2 = gql`
...
0
votes
1
answer
42
views
What is the correct graphql response if a requested child object does not exist?
What shall the graphql server return if a child object does not exist?
Example schema:
type Person {
name: String!
address: Address
}
type Address {
street: String
city: String
}
On the ...
0
votes
0
answers
38
views
GraphQL Client with spring boot
I have a spring boot GraphQL API and I want to consume it in another spring boot app using GraphQL Client. I am using spring boot version 3.
when I execute mutate which works as data is added to the ...
0
votes
1
answer
30
views
Best way to performantly resolve nested GraphQL queries with MongoDB
I am trying to write a resolver which gets the accounts belonging to a customer. The parent.accounts attribute is an array of account_ids. In the code below, I attempt to get an array of accounts for ...
0
votes
1
answer
29
views
Why does @graphql-codegen/typescript declare the resolver parent type to be an output type?
I am using @graphql-codegen/typescript to generate types for this graphql schema:
type Book {
title: String
author: String
comment: String
}
type Query {
books: [Book]
}
Excerpt from the ...
0
votes
0
answers
36
views
GraphQL Swapi api - getting error when fetching
I tried my luck with this mini graphql api,
but before getting into the point of this question i have some questions before:
When using swapi api for example and more specific i want to fetch films , ...
0
votes
0
answers
15
views
Unable to connect to WPGraphQL
I am new to building with Gatsby and wordpress. when i run "gatsby develop", i get this error on my command line
"Unable to connect to WPGraphQL, Either WPGraphQL is not active or ...
1
vote
1
answer
13
views
Graphql-go Has No Built-In Validation For Argument/Variables Passed On?
I am building golang graphql endpoint with graphql-go
https://github.com/graphql-go/graphql
Here is chunk of my resolver.go
func GetRootMutation(db *gorm.DB, req *http.Request) *graphql.Object {
...
0
votes
0
answers
16
views
Graphql requests returning 429, but working fine when using http.client or when running curl in terminal
Using below requests returns 429 status code, but when same request is used in curl, and by using Python http.client library, i get 200 status code and data.
What can be issue where requests gives 429 ...
0
votes
0
answers
17
views
Support for multiple paths pointing to different graphql schema
I have two graphql schemas that we can say one as admin and one as internal and i need to map each with a separate graphql endpoint as:-
Schema - admin.graphqls, internal.graphqls
/graphql/admin and /...
0
votes
0
answers
38
views
Target class [App\\GraphQl\\Types\\Admin\\CitiesType] does not exist
I am using graphql in laravel project
every thing work fine at localhost but when i deploy to server namecheap i faced this problime
Target class [App\GraphQl\Types\Admin\CitiesType] does not exist.
&...
0
votes
0
answers
20
views
onConnvect, graphql-ws subscription
thank you for your time, my problem is that i want to return the data to the client immediately after subscribing. I know about the onConnect method, but it is called before JwtAuthGuard. What is the ...
0
votes
0
answers
7
views
Properties with type "object" are ignored in the input types in Hotchocolate GraphQL. Is there a workaround to it?
I have an input class that has a single property with "object" object type as shown below:
public class FilterParameterValue
{
public object Value = new object();
}
When I start the ...
0
votes
2
answers
43
views
Call graphql query from form submit
I have a simple react app like
const [shoe, setShoe] = useState('')
formSubmit = () => {
e.preventDefault()
const { data } = useQuery<GetShoeDetailsQuery,...
-2
votes
0
answers
27
views
Convert a comma separated string of fields to a GraphQL query syntax
I have a requiremenet where I need to parse a user input comma separated string, and generate a graphql query out of it.
INPUT:
queryPath
fieldA.fieldB, fieldA.fieldC, fieldA.fieldD.fieldE, fieldA....
0
votes
1
answer
25
views
Handling auth token expiration in apollo client NextJS13
I'm trying to handle the expiration of auth token in GraphQL, Apollo client in NextJS 13 application. This is the code I've written for the client provider,
"use client";
import React from &...
0
votes
1
answer
77
views
How to use AWS Amplify GraphQL search and aggregate queries in React code?
In the current AWS Amplify React documentation there are no any examples showing how to use these GraphQL queries in React code. Can someone please post an example here. Authentication method needs be ...
1
vote
0
answers
45
views
How to make sure my graphql subscription api is working?
This is my subscription resolver in golang:
func (r *subscriptionResolver) CreateChatWithBot(ctx context.Context, req model.CreateChatWithBotRequest) (<-chan *model.CreateChatWithBotResults, error) ...
0
votes
0
answers
15
views
Graphql Codegen adds an extra property for my custom scalars
I just recently added the typescript-resolvers plugin to my codegen config, and while it does what I need, it seems to also add my custom scalars to the ResolversTypes.
The issue is that it seems to ...
0
votes
0
answers
9
views
Error: Gatsby query was left in the compiled code while testing with vitest
I am working on a Gatsby website and while testing a component with a graphql query using vitest I keep getting this error :
Error: It appears like Gatsby is misconfigured. Gatsby related graphql ...
-1
votes
0
answers
43
views
AWS CDK newly added data delay issue to display [closed]
I am facing data delay issue in my application. When I add new data it take to much time to display on live site but working fine when I attach live database with my local code.
CDK usually take 5 to ...
0
votes
0
answers
19
views
How to use graphql with remix.run
I have an endpoint http://localhost:1337/graphql where i query a lot of things from strapi but i am trying to use remix.run (tsx) as. my framework, there are no latest tutorials as to how to integrate ...
-2
votes
0
answers
15
views
Why does this AWS AppSync GraphQL query not work?
I am trying to create a appsync resolver to query an aurora-postgresql database. I have created a Movie table and have the following mutations(postMovie) and Queries(listMovies, getMoviesByName, ...
0
votes
0
answers
32
views
axios error code 499 for chrome extension
i'm using axios to send some queries to leetcode to access their graphql API. I'm using a chrome extension that reads the necessary cookie credentials so that i can use it as auth for the API. however,...
0
votes
0
answers
24
views
@graphql-codegen/typescript-react-query not generating object format for useQuery
I am using @graphql-codegen/typescript-react-query to generate typescript from my graphql schema.
these are my @graphql-codegen dependencies
"@graphql-codegen/cli": "^5.0.0",
...
0
votes
0
answers
8
views
How do I use web socket inside a graphql mutation using socket.io and expressGraphQL?
`I have been trying to emit an event to a specific user using socket.io when a specific mutation is called
I tried to use this on my main server file:
const graphqlMiddleware = expressGraphQL((req, ...
0
votes
0
answers
21
views
Query new field in GraphQL in backward compatible manner
So there is this new field added to the server API that the client wants to use. But the client also still needs to work with the older installs of the server that don't define that field yet.
...
0
votes
0
answers
7
views
Codegen and Graphql-Request Error: Server Error TypeError: Cannot read properties of null (reading 'useState')
This is the Error image im getting when I start my frontend
Server Error
TypeError: Cannot read properties of null (reading 'useState')
This error happened while generating the page. Any console logs ...
0
votes
0
answers
35
views
Reconfigure dataloaders when migrating from graphql-java-kickstart to spring-graphql
I'm in the process of migrating a GraphQl-java-kickstart project to Spring-GraphQl, as Spring-GraphQl was not available at the time when GraphQL was implemented in the project. The main reason for ...
0
votes
0
answers
11
views
Amplify sort property from a model
I'm using graphql from amplify
I have a 2 models Conversation and Message.
Message model belongs to Conversation (conversation has many messages)
So when I get Conversation by some criteria I want my ...
0
votes
1
answer
25
views
Track image upload progress in graphql mutation
I am running a graphql mutation to upload an image to the server. And operation is done successfully. My only question is that how do i track the progress of image upload on frontend? What percentage ...