Tag: graphql
-
TypeError: graphql.e is not a function
0 enter image description here I’m trying to add wallet connect provider to my project but after so many tries stuck at one of this error which is not getting by me. Project’s discription: node version: 14.18.3 next: 9 typescript: 5 webpack: 4 I have custom webpack also where i added more loaders. below code…
-
How to delete an object by pressing a button with onClick via mutation
0 There is code with GraphQL in bff and in the application part. This function is described as follows: shema.js: type Mutation { deleteCart(id: Int): [Cart] } index.js: deleteCart: (_, args) => { carts = carts.filter((c) => c.id !== args.id); return carts; } As declared in query: export const CART_ITEMS = gql` mutation DeleteCart ($id:…
-
Custom filters doesn’t apply for GraphQL collection query in API Platform
0 I’m using API Platform and I want to add graphQL support and keep the same behavior between my REST calls and my graphQL calls. I have some custom filters for my get collection that works fine with REST, but they are not recognized in graphQL. According to the doc, I’ve added the following so…
-
FetchError: invalid json response body GraphQL
0 I’m using @apollo/datasource-rest to wrap a 3rd party API. The endpoint I’m trying to hit checks if an email is already in use or not. If the email is in use the response looks like this "body": "True", "statusCode": 200, "contentType": "application/json", If the email is not in use the api returns a 404…
-
useSubscription Socket errors being thrown in the console
1 I hope you are doing well! We are using web sockets in our website with graphQL hence we are using useSubscription. It is working fine, I get the data back when I need it; however, we are facing a small issue that while it is not stopping our website from functioning, it is extremely…
-
Error: @default only accepts scalar types, which might be why the array lints badly
0 I’m trying to amplify push my updated amplify/backend/api/<myAPIName>/schema.graphql file. I am getting the following error: An error occurred during the push operation: / Schema validation failed. Expected type String, found ["Admins", "Users"]. canRead: [String] @default(value: ["Admins", "Users"]) Expected type String, found ["Admins", "Users"]. The offending code in schema.graphql: type Card { … canRead: [String]…
-
issue with graphql-request react onClick handler
0 I am using graphql-request to execute a mutation in an onClick handler in a react application The mutation executes successfully (I can verify by looking at the logs in the backend). The code in onClick handler (loginHandler) following the gqlClient.request never executes (console.log or alert) here is the code, any idea what am I…
-
In a GraphQL server, what is the best practice for triggering a subscription event from data received that needs to be parsed first?
0 Example: I receive data in a string that needs to be parsed first, for example an IoT message. I can create a mutation for that no problem, I’m just storing a string in a DB, however, based on what was in the string, I then save data of very different types, so I will…
-
How to properly pass a user and run middleware on apollo server v4
1 I am creating an apollo server v4 gql gateway with the express.js integration. I have user typedefs and user resolvers working and creating a jwt when a user is created. I then try to use my jwtMiddleware middleware on the /graphql endpoint so that it can validate a bearer token is being passed in…
-
GraphQL only works on production when also running localhost and Apollo Client is set to localhost only
1 Im working an app using react for the frontend and apollo/client and graphql. It works perfectly on the localhost, but when I deploy to heroku it only works if I also have the app running on the localhost. Here is what I have for the uri. const client = new ApolloClient({ uri: ‘https://localhost:5000/graphql’, cache:…