Tag: apollo
-
Error: Cannot find module ‘graphql/validation/rules/KnownArgumentNamesRule’
26 When I run the command apollo client:codegen the following error comes up : Error: Cannot find module ‘graphql/validation/rules/KnownArgumentNamesRule’ Require stack: – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistcompositionvalidatepreNormalizationtagDirective.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistcompositionvalidatepreNormalizationindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistcompositionvalidateindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistcompositioncomposeAndValidate.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistcompositionindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modules@apo llofederationdistindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modulesapol lo-language-serverlibprovidersschemafile.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modulesapol lo-language-serverlibprovidersschemaindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modulesapol lo-language-serverlibprojectbase.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollonode_modulesapol lo-language-serverlibindex.js – C:UsersMinseoAppDataRoamingnpmnode_modulesapollolibcommandsclie ntcodegen.js -…
-
Mutation Chaining in apollo superGraph
0 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 one mutation to the other one). Can we do a query, get an Id and then use that in a…
-
Implementing Middleware to Retrieve JWT Tokens from Header in a GraphQL Server with Node.js and Apollo
0 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 = require(‘jsonwebtoken’); const { GraphQLError } = require(‘graphql’); module.exports = async ({ req }) => { console.log(‘hello’);…
-
Handling error in apollo graphql returns invalid doctype even when content type is json
-1 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 is sending out html instead of json content type because I’ve already set it Here is the json-server Here’s my…
-
@apollo/client local-only field is not resolved when working with service worker
0 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 { getDebtTokens { totalSupplyUSD totalReserve totalReserve24hAgo token { address symbol priceUSD @client priceUSD24hAgo } } } `; And this is the config to…
-
can’t persist user session in apollo-graphql with express-session
0 I have nextjs-nodejs project, where I use apollo-graphql and Prisma, so when I create a user, I should send a session to "getSession" function, which is a mutation, and this mutation uses express-session to save the user info like that: getSession: async ( _: any, args: any, { prisma, session }: GraphqlContext ) =>…
-
GraphQL mutation in KeystoneJS: “Cannot use ‘in’ operator to search for ‘id’ in undefined”
0 In a KeystoneJS GraphQL project I’m trying to create a new data object (an “Article”) in the ‘resolveInput’ hook of another, existing, data object (a “Proposal” — when a Proposal is approved, I create an Article based on that Proposals’data). This worked fine using the Mongoose adapter, but I’ve tried to do it using…