graphql-js Questions

2

Solved

I am trying to return a authentication token in response to a graphql query with username and password as arguments, but somehow graphql is always returning null. I am able to print the token...
Dealate asked 31/10, 2016 at 18:8

1

Solved

I've seen some tutorials and examples out there who are sometimes using parent and sometimes using root for their first argument in a graphql resolver. What would be the correct naming in which si...
Lowry asked 29/10, 2018 at 18:29

1

In my database the Event field was populated both dynamically with an array of strings while some were populated manually with text (No array). When I execute my query the results that were populat...
Neruda asked 20/10, 2018 at 22:39

1

Solved

I'm testing Gatsby and GraphQl for the first time and I'm trying on a simple example.... I have this error when I want to display the title via a GraphQl request in my layout? : Uncaught TypeError...
Apyretic asked 12/10, 2018 at 12:58

1

Solved

I am making a GraphQL API where I would be able to retrieve a car object by its id or retrieve all the cars when no parameter is provided. Using the code below, I am successfully able to retrieve...
Radius asked 12/10, 2018 at 5:28

1

Solved

I read a lot around: https://github.com/pillarjs/understanding-csrf https://security.stackexchange.com/questions/10227/csrf-with-json-post Are JSON web services vulnerable to CSRF attacks? (Nothi...
Caucasia asked 28/8, 2018 at 14:52

1

Solved

Right now I have this tag below. It's static and will always get a comment with the id of 3. Is there a possible way to put a variable inside this graphQL-tag. So I can re-use the graphQL-tag, and ...
Gammon asked 1/10, 2018 at 9:46

1

Solved

In an express-graphql app, I have a userLogin resolver like so: const userLogin = async ({ id, password }), context, info) => { if (!id) { throw new Error('No id provided.') } if (!passw...
Helles asked 27/9, 2018 at 7:42

1

When writing queries I can define a resolver on any field and that field’s value will be determined by its resolver, regardless of query depth. However when writing a mutation I seem to only be ab...
Flyback asked 2/9, 2018 at 17:54

1

I was wondering if there's a way to share the common fields between Input and Type in GraphQL so that I don't have to define the same set of fields in multiple places. Example: input PersonInput ...
Canthus asked 30/8, 2018 at 16:10

1

Solved

I am working with GraphQL and I want to have strict typing in gql. Is it possible to make result variable to be shape of ResultData i.e. with the latest version of TypeScript. It is only about typi...
Fatsoluble asked 22/8, 2018 at 13:36

1

Solved

I am building a GraphQL schema programmatically and in need of a Timestamp scalar type; a Unix Epoch timestamp scalar type: const TimelineType = new GraphQLObjectType({ name: 'TimelineType', fie...
Lipski asked 13/8, 2018 at 21:25

3

Solved

I use first after and last before to do pagination. hasNextPage and hasPreviousPage are very useful. But what I need is also the total count so that I can calculate and show things like page 5 of ...
Nonproductive asked 10/12, 2015 at 2:6

1

I was trying to create an enum type with Int value in GraphQL schema but failed. I might miss something in the doc. Anyone has any idea about how to implement Int value in the enum type like below?...
Georginegeorglana asked 1/8, 2018 at 4:14

1

Solved

We have a bunch of enum types defined in an SDL and they work great for queries and mutations. In the resolvers section these are mapped to the strings which represent those enums in the back end....
Nonjoinder asked 31/7, 2018 at 1:19

1

I am using the apollo graphql server. I have a query that works well unordered. query feedQuery { allPostsFromAllBlogs { id blogId title text likes createdAt } } I want to sort the res...
Ronnironnica asked 23/3, 2018 at 21:49

2

I have a mutation: const createSomethingMutation = gql` mutation($data: SomethingCreateInput!) { createSomething(data: $data) { something { id name } } } `; How do I create many Somethin...
Shutter asked 16/6, 2018 at 16:10

5

Does anyone have any experience with GraphQL and Firebase? I figure one would place the firebase calls in the resolver of the relevant field, passing some variable from the props of the compo...
Tractor asked 31/5, 2016 at 1:4

2

Solved

Consider: const GET_DOGS = gql` { dogs { id breed } } `; I found this new syntax from here. What is the explanation for this syntax? Where can I find detail about it?
Saharan asked 4/5, 2018 at 17:37

1

The following executes correctly in graphiQL fragment BookGridFields on Book { _id title } { allBooks { ...BookGridFields } } My question is, it possible to specify the fragment right in...
Multiangular asked 12/10, 2017 at 5:1

1

Solved

The payload field can be Int or String scalar type. when I write it like union type: const schema = ` input QuickReply { content_type: String title: String payload: Int | String image_url: Str...
Kilbride asked 18/4, 2018 at 10:24

1

Solved

I have a graphql endpoint which is authorised by a JWT. My JWT strategy verifies the JWT then adds the user object to the request object. In a restful route, I would access my users' data like so...
Apollyon asked 11/4, 2018 at 13:10

1

Solved

Context I have a GraphQL API and a NodeJS & Angular application with a MongoDB database that holds users. For each user, there is a public page with public information like id and username. Whe...

2

Solved

I am looking to hot reload my GraphQL schema on my apollo-server-express server. Anyone would have any idea about how to do that? I'm currently using schemas stitching to gather multiple API's sch...
Labiodental asked 15/1, 2018 at 10:27

2

I did this sample: https://github.com/Akryum/vueconf-2017-demo As a result, I have the same file in my project: https://github.com/Akryum/vueconf-2017-demo/blob/master/src/apollo-client.js This i...
Wesleyanism asked 27/10, 2017 at 0:2

© 2022 - 2024 — McMap. All rights reserved.