Questions tagged [graphql-tools]

A set of utilities to build your JavaScript GraphQL schema in a concise and powerful way.

GraphQL Tools is an npm package and an opinionated structure for how to build a GraphQL schema and resolvers in JavaScript, following the GraphQL-first development workflow.

Documentation

Repository

115 questions
1
vote
0 answers

How can I merge a schema after infer it from the driver?

I'm using inferSchema for generate GraphQL type definitions directly from the neo4j database, like this: const inferAugmentedSchema = driver => { return inferSchema(driver).then(result => { return makeAugmentedSchema({ …
1
vote
0 answers

graphql execution workflow

TL-DR: How can I let the graphql.js engine recursively call resolvers|directives returning schema-unrelated-objects? any link to some in-depth doc about graphql execution flow? Details: I need to leverage graphql.js execution workflow in a custom…
aleclofabbro
  • 1,635
  • 1
  • 18
  • 35
1
vote
0 answers

How to import resolvers dynamically to schema in meteor?

I am trying to import resolver and type files into schema dynamically and I use meteor-cleverbeagle starter kit. But when I try to use loadFilesSync method, I get this on console: Error: Cannot find module 'meteor/mongo'. How can I import resolvers…
Çağatay Sert
  • 413
  • 2
  • 5
  • 16
1
vote
0 answers

Multiple GraphQL entities in root mutations/queries?

How to add multiple queries/mutations from different entities to graphql schema? I have file called User.graphql and defined schema: import UserQueries, UserMutations from 'User.graphql' schema { query: UserQueries, mutation:…
Sheppard25
  • 493
  • 1
  • 7
  • 22
1
vote
1 answer

how to implement resolveType function / initialise graphQL server in express

I have 2 questions regarding the GraphQL. I created a schema using makeExecutableSchema so I can create a executableSchema. I exports executableSchema and initialising the server in my app.js like this. app.use('/graphql', graphqlHTTP({ …
yoonvak
  • 303
  • 1
  • 3
  • 15
1
vote
1 answer

Storing a variable "gobally" within a class to be used by multiple methods in a graphql directive

So i feel like my question is most likely a JS syntax question regarding classes and this but my issue is directly related to graphql-tools class SchemaDirectiveVisitor which is used for creating custom directives in GraphQL. A little context: When…
xunux
  • 1,531
  • 5
  • 20
  • 33
1
vote
1 answer

Schema Directives don't execute in LTR order specified in schema

I am using graphql-tools@v6 and I have implemented two directives @map and @filter. My goal is to use them like a map and filter pipeline. In some cases, I want to map before filtering and in other cases, vice-versa. The directives are implemented…
drcocoa
  • 1,155
  • 1
  • 14
  • 23
1
vote
0 answers

How to force a filter on server side to a graphql query?

Imagine the condition that I have a query called "users" that returns all the users and these users can be associated with one or more companies, so I have a type UserCompanies (I need it because it saves some more information beyond the relation).…
arceliver
  • 336
  • 1
  • 11
1
vote
2 answers

What's the programmatic difference between a GraphQL query and an Object field?

Does anyone know how I could programmatically differentiate between a graphql query and a field? I'm talking about this: type User { id: ID! <-- this would be a field } type Query { getUsers: [User]! <-- this would be a query } I've tried to…
DanielOrtel
  • 103
  • 9
1
vote
0 answers

Apollo delegateToSchema - how to send subquery of child resolver from parent resolver

I have parent schema in graphql that built with apollo libraries apollo-server and graphql-tools that delegates subqueries to remote graphql schema. For example the query below delegate the subquery of User.booking to the remote schema and it's…
Ron Badur
  • 1,873
  • 2
  • 15
  • 34
1
vote
0 answers

How to make makeExecutableSchema ignore directives?

Is there a way to tell makeExecutableSchema from graphql-tools to ignore certain directives? I want to query my neo4j database with graphql. I also want to be able to specify subtypes in graphql. There is a library called graphql-s2s which adds…
helpusobi
  • 23
  • 1
  • 6
1
vote
1 answer

express-graphql resolver args is empty in resolver but info variableValues populated with name and value

Using apollo-server-express and graphql-tools, I am attempting to create a minimally viable schema from a JSON object: const books = [ { "title": "Harry Potter", "author": 'J.K. Rowling', "slug": "harry_potter", }, { "title":…
mibbit
  • 4,997
  • 3
  • 26
  • 34
1
vote
1 answer

Cannot access shared schema from other schema.graphql file in another schema.graphql file in schema stiching

I have user schema in a userSchema.graphql file; id: String! userName: String! email: String! password: String! } and I have different schema.graphql file for login and register and I cannot access User schema in the login/register…
prabeen90
  • 450
  • 3
  • 12
1
vote
1 answer

Write resolvers for nested type definitions

Suppose I have following type definition for my GraphQL API: const typeDef = ` type Book { title: String author: Author likes: Int } type Author { id: String name: String age: Int …
1
vote
1 answer

getDirectives error when printing remote schema with graphql-tools

I have two node servers both serving graphql via express-graphql. I wish to have my first server stitch its schema with that of the second server. I have followed these instructions at:…
schwarz
  • 193
  • 2
  • 11