()
| 262 | See also code in https://github.com/nestjs/graphql/blob/master/lib/graphql.module.ts how it's done by Nest |
| 263 | */ |
| 264 | createSchema(): GraphQLSchema { |
| 265 | const graphqlPath = './**/*.graphql'; |
| 266 | |
| 267 | console.log(`Searching for *.graphql files`); |
| 268 | |
| 269 | const typesArray = loadFilesSync(graphqlPath); |
| 270 | |
| 271 | const typeDefs = mergeTypes(typesArray, { all: true }); |
| 272 | |
| 273 | // we can save all GraphQL types into one file for later usage by other systems |
| 274 | // import { writeFileSync } from 'fs'; |
| 275 | // writeFileSync('./all.graphql', typeDefs); |
| 276 | |
| 277 | const schema = makeExecutableSchema({ |
| 278 | typeDefs, |
| 279 | resolvers: { |
| 280 | ...SCALARS, |
| 281 | }, |
| 282 | }); |
| 283 | |
| 284 | return schema; |
| 285 | } |
| 286 | } |
nothing calls this directly
no test coverage detected