graphql-js Questions

2

I am new to graphql and I am struggling with a query. I want to return a user by their email address I have a type defined call V1User and it has the following fields id, email, password, role Wh...
Bromoform asked 11/2, 2018 at 12:13

3

need some help. Let say Im requesting the following data: { parent { obj1 { value1 } obj2 { value2 } } } And I need the result of value2 in value1 resolver for calculation. Thought of r...
City asked 11/1, 2017 at 17:30

3

Solved

I have a Gatsby GraphQL query for a list of posts ordered by date and filtered by category. { posts: allContentfulPost( sort: {fields: [date], order: DESC}, filter: {category: {slug: {eq: $slug...
Bergschrund asked 26/6, 2018 at 16:38

2

I use mongoose, typescript and graphql to build my app. I am a full-stack developer. The problem is I define the fields and types of model FIVE times. server side: models/book.ts: // first tim...
Nelia asked 8/8, 2018 at 6:46

1

Solved

I have a very basic graphql mutation in the frontend that I send to my backend. I am using this code on the by graphql-request as a guide. With primitives it works: const mutation = gql` mutation ...

3

Solved

I was thinking about ways of implementing graphql response that would contain both an error and data. Is it possible to do so without creating a type that would contain error? e.g. Mutation addM...
Christoper asked 12/10, 2018 at 10:59

3

I have the following schema: enum PaymentTypeName { PAYMENT_CARD PAYMENT_CARD_TOKEN } interface Payment { id: ID! type: PaymentTypeName! } type PaymentCardPayment implements Payment { id: I...
Gloriane asked 9/6, 2017 at 13:30

2

I have the following graphql schema definition in production today: type BasketPrice { amount: Int! currency: String! } type BasketItem { id: ID! price: BasketPrice! } type Basket { id: ID!...
Goosefish asked 4/7, 2019 at 17:27

1

Solved

I have a GraphQL powered app. The query and mutation parts work well. I try to add GraphQL subscription. The server GraphQL subscription part code is inspired by the demo in the readme of apollogr...
Transliterate asked 19/7, 2019 at 0:48

6

Is it possible to specify that a field in GraphQL should be a blackbox, similar to how Flow has an "any" type? I have a field in my schema that should be able to accept any arbitrary value, which c...
Equipotential asked 9/8, 2017 at 19:6

4

Solved

I have some object types that I'd like to use as both input and output - for instance a currency type or a reservation type. How do I define my schema to have a type that supports both input and o...
Copro asked 6/1, 2017 at 22:54

3

Solved

I am using apollo-server and apollo-graphql-tools and I have following schema type TotalVehicleResponse { totalCars: Int totalTrucks: Int } type RootQuery { getTotalVehicals(color: String): To...
Umberto asked 22/1, 2018 at 13:37

2

Solved

I am studying GraphQL and I get a bit confused from different implementations on the specific issue when writing the fields of a GraphQLObjectType. What is the difference between these two implemen...
Alceste asked 19/9, 2016 at 18:1

1

Solved

I am having terrible problems getting a real cursor for resolving a database pagination result in GraphQL. No matter what kind of database (SQL e.g. mysql or NoSQL document e.g. mongodb) I am using...
Cerargyrite asked 11/7, 2019 at 12:45

1

Solved

I want to get an array of strings as ids parameter from the query variables and use it inside my resolver. Below here is my code. People.resolver.ts import { Resolver, Query, Mutation, Args, } fro...
Gesellschaft asked 22/6, 2020 at 10:52

1

Solved

So I recently tried upgrading my node from 13 to 14, but afterwards I was having issues with graphql. What happened was that I was forever "pending" whenever I sent a request to the server. The pr...
Cystine asked 4/5, 2020 at 8:20

1

I want to implement cursor based pagination in Apollo graphql server. I have prepared schema with pagination requirement. But i am stuck at resolver side. Here is my schema const typeDefinitio...
Disturbance asked 6/6, 2017 at 7:11

1

Trying to refactor my gatsby-node file, by outsourcing a bit of code. Right now trying to do this in my gatsby-node: const createBlogPostPages = require("./gatsby-utils/createBlogPostPages"); exp...
Crevasse asked 14/2, 2020 at 11:2

1

Solved

I want to use a single mutation for the application to send user info to server and then get the top level query in the output. (I know this is not a good convention but I want to do this to test i...
Bandicoot asked 14/7, 2018 at 7:50

1

Referencing the type-graphql sample repo in the NestJS repository here I am wondering how to create two more layers deep in the query. Currently it is setup to query recipes, I was able to add ano...
Engineering asked 6/5, 2019 at 3:48

1

I have the following model type Duck { category: Baz } type Foo { size: FooSize } type Bar { size: BarSize } union Baz = Foo | Bar The following query throws an error Validation error of ...
Surcharge asked 14/10, 2019 at 15:25

1

Solved

I'm using DataLoader for batching the requests/queries together. In my loader function I need to know the requested fields to avoid having a SELECT * FROM query but rather a SELECT field1, field2, ...
Zed asked 21/9, 2017 at 19:51

1

Solved

I'd like to use an array inside a GraphQL query variable so that I can get the data of more than one product from a single query with Gatsby however at the moment I get errors. My graphQL query lo...
Madewell asked 22/9, 2019 at 14:50

1

Solved

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 provi...
Remission asked 18/9, 2019 at 8:51

4

If I have an object: {"where":{"publishedAt_lt":"2018-01-01"}} How can I convert it to a string suitable for query arguments? articles(where: {publishedAt_lt: "2018-01-01"})
Godinez asked 2/6, 2018 at 18:41

© 2022 - 2024 — McMap. All rights reserved.