-
Notifications
You must be signed in to change notification settings - Fork 148
makeAugmentedSchema should work with array of typeDefs #196
Comments
You can do: Merge schemasimport * as neo4jgql from "neo4j-graphql-js";
import { mergeSchemas } from "graphql-tools";
import { GraphQLSchema, GraphQLObjectType, printSchema } from "graphql";
const typeDefs = [`type Person {name: String}`, `type Book {title: String}`];
const augmentedSchema = neo4jgql.makeAugmentedSchema({
typeDefs: printSchema(
mergeSchemas({
schemas: typeDefs
})
)
}); Real world example |
👍 Thanks @Stradivario This works for me after updating graphql-tools version 5.0.0-rc.0 (because of ardatan/graphql-tools#815) Btw, do you know how I can use this to merge schemas with |
mergeSchemas function is removing the directives. My current workaround is to concatenate typeDef strings. Are there any better workarounds? Is there a way to fetch the relation / cypher directives so that we could add it to schemaDirectives while merging? |
Passing an array of type definitions (instead of a single SDL string) is supported by graphql-tool's
makeExecutableSchema
and should also be supported bymakeAugmentedSchema
.For example:
Currently this gets hung up in
extractTypeMapFromTypeDefs
The text was updated successfully, but these errors were encountered: