Skip to content

Commit

Permalink
Merge pull request #13 from AustinMusiku/fix-unable-to-merge-schema
Browse files Browse the repository at this point in the history
Fix: Fixed allow override schema field types
  • Loading branch information
AustinMusiku authored Sep 20, 2023
2 parents a2a9f08 + 44c0d48 commit 0f1007a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader'
import { loadSchemaSync } from '@graphql-tools/load'
import { addResolversToSchema } from '@graphql-tools/schema'
import { readFileSync } from 'fs'
import { join } from 'path'
import { createSchema } from 'graphql-yoga'
import resolvers from '../resolvers'

// Load typedefs from the file
const schema = loadSchemaSync('**/*.graphql', {
loaders: [new GraphQLFileLoader()]
const schema = createSchema({
typeDefs: readFileSync(
join(__dirname, '../typedefs/index.graphql'),
'utf8'
),
resolvers
})

// Add resolvers to the schema
const schemaWithResolvers = addResolversToSchema({ schema, resolvers })

export default schemaWithResolvers
export default schema

0 comments on commit 0f1007a

Please sign in to comment.