Tag: express-graphql
-
GraphQL Swapi api – getting error when fetching
1 Im kinda new to graphql but 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 , when i write the filmType GraphQLObjectType do i have…
-
How do I use web socket inside a graphql mutation using socket.io and expressGraphQL?
0 `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, res) => ({ schema, graphiql: __DEV__, rootValue: { request: req, response: res, }, pretty: __DEV__, })); app.use("/graphql", graphqlMiddleware); let server…
-
apollo explorer say “isTrusted”: true when i try use Subscription
3 guys, I have a problem when I want to use a Subscription I’m facing this issue I don’t find a solution in any place, I’m a GQL user and i decide to use Subscription to make real-time website but I’m facing a a this issue , hare is code I’m trying to show apollo…
-
Data not displayed in React.js frontend with graphql
0 graphql query running import { gql } from ‘@apollo/client’; const GET_CLIENTS = gql` query getClients { clients { id name email phone } } `; export { GET_CLIENTS }; import {gql} from ‘@apollo/client’; const DELETE_CLIENT = gql` mutation deleteClient($id: ID!) { deleteClient(id:$id) { id name email phone } } `;[enter image description here][1] export…
-
Data not displayed in mongodb with graphql
0 graphql query running import { gql } from ‘@apollo/client’; const GET_CLIENTS = gql` query getClients { clients { id name email phone } } `; export { GET_CLIENTS }; import {gql} from ‘@apollo/client’; const DELETE_CLIENT = gql` mutation deleteClient($id: ID!) { deleteClient(id:$id) { id name email phone } } `;[enter image description here][1] export…
-
query mongodb with express and graphql
3 how do we use graph ql with mongo db here is my code with resolvers var resolvers = { test:()=>{ return getproducts() }, } const getproducts=()=>{ return new Promise((resolve,reject)=>{ Product.find({}).exec() .then(resp=>{ console.log("response is ",resp); let stringData = resp.toString() resolve(stringData); }).catch(err=>{ console.log(‘error is ‘,err); reject(err); }) }) } and schema is : test:String! i am…
-
How do I define a typeDefs in a Schema for the following Response
0 I am Trying to Define a typeDefs for the following response in graphql CompactRes={ "Compact": [ [ 0, 1, 2, 3 ], [ 4, 5, 6, [ 7, 2.567 ] ]]} Here is my Schema const typeDefs = gql` type Compact{ compact:[[Float]] } type Query { response(count: ID!): Compact } `; const resolvers =…
-
make graphql mutation return multiple types
0 i’m working on creating mutations for a project i’m working on but stuck on the resolver returns, i won’t to handle the errors while i’m at it as well by sending back messages for notifications to make it user friendly, but let’s say my mutation is UPDATE_USER and it should also return the updated…
-
Unable to install express-graphql
9 I’m trying to install express-graphql but getting this error. Please, help! npm install –save express-graphql npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/graphql npm ERR! graphql@"^16.2.0" from the root project npm ERR! npm ERR! Could not…