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
0
votes
0 answers

Unable to find any GraphQL type definitions for the following pointers: when usiing graphql-tool's JsonFileLoader

When using the graphql-tools JsonFileLoader with the follow schema.json: { "UserObjectType": { "id": "Int", "username": "String", "firstName": "String", "lastName": "String", "avatar": "AvatarObjectType", "dateCreated":…
Fredmental
  • 445
  • 1
  • 7
  • 14
0
votes
1 answer

Does Apollo Server work with GraphQL Tools stitchSchemas?

According to Apollo docs "Apollo Server 2 exports all of graphql-tools, so makeExecutableSchema and other functions can be imported directly from Apollo Server." "Apollo Server is able to accept a schema that has been enabled…
Vok
  • 457
  • 5
  • 19
0
votes
1 answer

How to load a GraphQL schema from two source locations with graphql-tools?

I want to load graphql schemas from different locations (local app and a common module). I do: export function GraphqlServer( resolvers: Record, config?: Config ) { const localScheme = '**/*.graphql'; const…
Michael
  • 6,823
  • 11
  • 54
  • 84
0
votes
1 answer

How can I combine a GraphQLObjectType with a schema created by graphql-tag with gql-tag?

I use graphql-tag together with apollo-server-express to connect to build a graphQL endpoint for an api. At the moment I create the schema definition like this: properties.js let model = {} const typeDefs = gql` extend type Query { …
anli
  • 515
  • 6
  • 9
0
votes
1 answer

GraphQL: Unknow directive include

I am practicing using directives with Graphql in Nodejs. When in the Playground I want to use the @include directive, the Graphql client tells me: "Unknow directive include". This is my code: query getChar($id: ID!, $withGames: Boolean!) { …
Luis
  • 2,006
  • 5
  • 31
  • 47
0
votes
1 answer

Apollo Server: how to post-process all `id: ID` fields without directives?

Our schema looks like this: type Product { id: ID! name: String! } type User { id: ID! firstName: String! } The backend returns auto-increment IDs, we want to prefix them by type and currently, we're using directives for that: type Product…
Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
0
votes
1 answer

How to invoke a query using graphql-tools

I want to build a GraphQL API. However, I do not want to use express or connect, which cuts me off from using express-graphql. My schema is generated using the makeExecutableSchema method from graphql-tools. That means I need to somehow manually…
Jake
  • 2,090
  • 2
  • 11
  • 24
0
votes
1 answer

How to nest qraphql resolvers so as to group them

I'm wrapping a series of REST APIs in GraphQL and I'm having trouble getting a resolver to work. My typeDefs const typeDefs = ` type Page { id: String path: String! title: String! heading: String type: String html: String …
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
0
votes
1 answer

Using graphql-tools, apollo-link-schema, and react-hooks always returning undefined when mocking

I'm new to using GraphQL in React and have been moving a project from a REST API to a new GraphQL one. As part of this, I wanted to setup mock data to work on the application independent of the GQL API being completed. I've spent a bunch of time…
TechyTech
  • 455
  • 2
  • 13
0
votes
1 answer

Best way to model data in nested arrays across local and remote schemas in Apollo GraphQL?

I am new to graphql and apollo. I've got a local Graphql schema which is using nested arrays of objects and is mapped over to mongoDB in the resolvers with Mongoose. type Category { id: ID! category: String! sections: [Section] } type…
0
votes
1 answer

Handle graphql schema stitching error in child query

I am new to graphql and want to understand the concept here. I have this graphql schema (stitched using graphic-tools). Not all cars have registration. So if I query for 5 cars and one car doesn’t have a registration (no id to link between cars and…
aiiwa
  • 591
  • 7
  • 27
0
votes
1 answer

Connecting AWS Appsync Graphql Link as a Gatsbyjs Datasource

Working to set up a GatsbyJS plugin that sources from AWS AppSync using IAM auth. I keep getting an error that I can't track down what the problem is. I don't have a ton of experience with graphql linking, and can't find good documentation on how to…
RedOster
  • 325
  • 3
  • 16
0
votes
0 answers

Problem when upgrading graphql-js from 14.1.1 to 14.3.0

i'm just upgrade graphql-js from version 14.1.1 to 14.3.0 and then my whole test fail after checking my code i found that problem is at resolver on interface type that i expect third parameter was context as code below __resolveType(obj, args,…
0
votes
1 answer

check for missing resolvers

How would you scan schema for missing resolver for queries and non-scalar fields ? I'm trying to work with a dynamic schema so I need to be able to test this programmatically. I've been browsing graphql tools for few hours to find a way to do this,…
Syffys
  • 570
  • 5
  • 21
0
votes
1 answer

Apollo: passing root to resolver with info.mergeInfo.delegateToSchema

I have a stitched graphql schema. Some type fields are resolved with info.mergeInfo.delegateToSchema Here's an example (which is from the apollo docs): const mergedSchema = mergeSchemas({ schemas: [ transformedChirpSchema, authorSchema, …
Le garcon
  • 7,197
  • 9
  • 31
  • 46