Tag: apollo-server
-
How to apply alias in @key field in apollo federation
0 type oPlayer @key(fields: "id") @key(fields: "name"){ id:ID name: String } extend type oPlayer @key(fields: "name") @key(fields: "PlayerId") { name: String @external PlayerId: ID @external } I am tring to resolve that field using PlayerId field with id but I am not able get data in referance resolver How to provide alias to "PlayerId:id" so…
-
Apollo-server hide graphql ui in production
1 I’ve been searching for an explanation of this. The question is kind of "basic" so I was hopping to find the solution quickly, but I haven’t. I want to hide the graphical ui in production server so anyone can’t see my queries, but I can’t. I don’t have problems to figure it out how…
-
How to accept POST request from a remote server on a GraphQL Server
0 I am working on a project currently using GrapQL. I am integrating a payment processor, when the user payment is successful, the payment processor sends a POST request to the webhook URL that is meant to point to my server. Now I was wondering how to achieve this, considering that GraphQL exposes just one…
-
Can’t consume context in my mutation resolver, request object passed instead Apollo Server v4
0 I am trying to pass the pubsub to resolvers. I am able to pass pubsub to subscription ‘subscribe’ functions via the useServer function, and as far as I can tell from research the expressMiddleware context should be passed to all resolvers, but when logging it out I’m just getting the request object. index.ts const…
-
Regarding dynamic field selection in apollo-server
0 I’m using apollo GraphQL for backend and frontend. I want to dynamically select fields which are requested by the client. With the help of info argument I created a function which gives me selected fields by client and based on that I fetch selected fields from db. Resolver selection.fields = .extractSelection(info?.fieldNodes[0]?.selectionSet) function implementation .extractSelection…
-
How To Config Apollo Sandbox for GraphQL in NestJS?
1 I am trying to use Apollo Sandbox for GraphQL in NestJs since I had to upgrade to apollo/server from apollo-server-express. I added the configuration like described in the NestJS docs. I also checked the Apollo Docs. My setup is now like described here. Here is what I use: "@apollo/server": "^4.7.3", "@apollo/server-plugin-landing-page-graphql-playground": "^4.0.1", "@nestjs/apollo": "^11.0.6",…
-
Regarding dynamic field selection in apollo srever
0 i am using apollo GraphQL for backend and frontend . i want to do dynamic selection of fields which is selected by client . so with the help of info argument i get i created a function which give me selected fields by client based on that i fetched selected fields from db. here…
-
With Apollo Graphql, is it the same having a field as null and not sending it?
0 I am implementing a React Typescript app that communicates to a Kotlin backend using GraphQL (Apollo on the Frontend). My mutation is : updateProfile(input: UpdateProfileInput) input UpdateProfileInput { firstName: String lastName: String email: String } I am supposed to send as an input only the fields that have been changed. So I should not…
-
Can’t use extensions with GraphQLError
3 From the Apollo Graphql document, this way can define extension error: https://www.apollographql.com/docs/apollo-server/data/errors/ import { GraphQLError } from ‘graphql’; throw new GraphQLError(‘the error message’, extensions: { code: ‘SOMETHING_BAD_HAPPENED’, https: { status: 404, headers: new Map([ [‘some-header’, ‘it was bad’], [‘another-header’, ‘seriously’], ]), }, }, ); But in my case it got this error: Argument of…
-
Apollo GraphQL: dynamically caching a schema type, not the entire resolver
0 I would like to use dynamic cache. I was able to set the cache maxAge into the query resolver, but since the resolver can return both an unsuccessful and a successful response I would like to only cache the successful one. In order to do this I would like to set up the info…