apollo-server

How can I debug a memory leak on my Apollo GraphQL server?

江枫思渺然 提交于 2019-12-23 10:49:21
问题 Answers to this question are eligible for a +200 reputation bounty. Bounty grace period has ended. Alexis Tyler is looking for an answer from a reputable source . I have a graphql server with multiple endpoints. It is basically just a CRUD app, so I'm honestly not sure why there's a memory leak. The only potentially leaky endpoint I have is one that uploads pics to S3. I've been looking around and have tried taking heap snapshots and comparing them but I'm not even sure which endpoint is the

Apollo Server - Confusion about cache/datasource options

佐手、 提交于 2019-12-21 05:23:13
问题 The docs (https://www.apollographql.com/docs/apollo-server/features/data-sources.html#Using-Memcached-Redis-as-a-cache-storage-backend) show code like this: const { RedisCache } = require('apollo-server-cache-redis'); const server = new ApolloServer({ typeDefs, resolvers, cache: new RedisCache({ host: 'redis-server', // Options are passed through to the Redis client }), dataSources: () => ({ moviesAPI: new MoviesAPI(), }), }); I was wondering how that cache key is used, considering it seems

Apollo Server - Confusion about cache/datasource options

筅森魡賤 提交于 2019-12-21 05:23:05
问题 The docs (https://www.apollographql.com/docs/apollo-server/features/data-sources.html#Using-Memcached-Redis-as-a-cache-storage-backend) show code like this: const { RedisCache } = require('apollo-server-cache-redis'); const server = new ApolloServer({ typeDefs, resolvers, cache: new RedisCache({ host: 'redis-server', // Options are passed through to the Redis client }), dataSources: () => ({ moviesAPI: new MoviesAPI(), }), }); I was wondering how that cache key is used, considering it seems

Array of Objects Apollo Server and post from react

柔情痞子 提交于 2019-12-17 21:22:15
问题 So i'm trying to figure out how to pass an array of objects from a POST request to apollo server on AWS lambda. I've checked this out but it's not the same problem Array of objects convert into object of objects when I use Apollo The post request looks like this... api.post('query', { query : `mutation {saveNewItem(description: "${description}", specials: ${JSON.stringify(specials)}){name}}`}) // comment to get rid of silly scroll bar overlapping code Schema looks like this... const { gql } =

GraphQL fetch data at Query level results in redundant/useless request

人走茶凉 提交于 2019-12-14 03:05:51
问题 We are implementing GraphQL service, which stands in front of several backend microservices. For example, we have a Product and each product has a list of history orders. Our backend server provides two REST APIs, one for product detail data, the other returns the history order list of a product. Our client app has two pages: one is the product detail page, the other is the history order list of a product. So, in the product detail page, we can only retrieve the detail data of the product,

Apollo GraphQL subscriptions is not working in Vuejs

烈酒焚心 提交于 2019-12-13 13:07:03
问题 I am using GraphQL Subscription with Prisma and vuejs + apollo client In local system, I am running vuejs at http://localhost:8080 and server at http://localhost:4000. I want to display recently added and updated records in dashboard. I have implemented subscription in my local system and it's working proper. I push all server side and client side code to server but subscription is not working there. I am using AWS server. Everything is working proper except subscription. I set up websockets

Transform apollo-datasource-rest response structure to adapt to the already defined remote schema

橙三吉。 提交于 2019-12-13 03:56:12
问题 We have remote schema already. We get Apollo datasource response by hitting the REST APIs using apollo-datasource-rest. The format of the json response does not match the schema. The task is to transform the json response to match the schema and return the result against the user query. How to achieve this? E.g REST API response: { "members": { "name": "john", "street_address": "10 Barley St." } } Our remote graphql schema: type Users { username: String! street: String! } Any ideas or help or

Why is “refproductoptions.getProductOptions is not a function” in this GraphQL resolver?

懵懂的女人 提交于 2019-12-11 15:53:41
问题 I'm using three tables from an associative relationship. The parent "products" has an id which is associated to the table RefProductOptions.productID. This works perfectly fine with my resolvers and GraphQL responds correctly. When I introduce the third table "productoptions" and I try to add an association layer between "refproductoptions.optionId" with "productoptions.id", the GraphQL look up fails. The GraphQL error message is: { "errors": [ { "message": "refproductoptions

Querying and Mutating a Form with Apollo Client GraphQL

被刻印的时光 ゝ 提交于 2019-12-11 10:39:00
问题 The whole GraphQL paradigm is new to me, usually working with React Redux. My requirements are: User clicks a Row Item w/ UID We open a form to edit this data (with previously saved information pre-populated) We then edit this data and save I would think (2) & (3) would be handled by a <Query><Mutation/><Query> type of structure but it doesn't work, mainly because setting state in the Query will make the textinputs controlled inputs... controlled by <Query> , and I can no longer edit it.

info argument is empty in Apollo GraphQL resolver type signature

*爱你&永不变心* 提交于 2019-12-11 06:33:41
问题 I'm working on this library https://github.com/ilyaskarim/wertik-js called Wertik JS to make GraphQL + Rest API more easily, In resolvers, when I console log info , it shows undefined. For each module, I have created dynamic resolvers to make things more easy for developers who will use this library. let object = { create: async (_:any, args:any, context:any,info: any) => { console.log(info); // This will be undefined let v = await validate(validations.create,args.input); let {success} = v;