Prisma1: `schemaPath` gets ignored

Created on 7 Feb 2018  路  3Comments  路  Source: prisma/prisma1

Bug Report

Current behavior

When moving the schema.graphql in the app project and adjust the schemaPath accordingly, it gets ignored when running yarn dev. The exception indicates that it still tries to fetch the now non-existing schema.graphql:

Error: No schema found for path: /Volumes/Data/projects/<myproject>/src/schema.graphql
    at new GraphQLServer (/Volumes/Data/projects/<my-namespace>/<myproject>/node_modules/graphql-yoga/src/index.ts:62:17)
    at Object.<anonymous> (/Volumes/Data/projects/<my-namespace>/<myproject>/src/index.ts:20:16)
    at Module._compile (module.js:635:30)
    at Module.m._compile (/Volumes/Data/projects/<my-namespace>/<myproject>/node_modules/ts-node/src/index.ts:422:23)
    at Module._extensions..js (module.js:646:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Volumes/Data/projects/<my-namespace>/<myproject>/node_modules/ts-node/src/index.ts:425:12)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)

Reproduction

  • Create a new project via prisma init (environment prisma/1.1.3 (darwin-x64) node-v8.9.1)
  • Use the typescript-basic boilerplate.
  • Create a new directory in src/schema/index.graphql
  • Adjust projects.app.schemaPath and point it to the new location
  • Execute npm run dev / yarn dev

Expected behavior?

Should use the new schema location.

Most helpful comment

Ahhhh, my fault. Of course! :)

Not a bug, closing the issue.

All 3 comments

That's the schemaPath in .graphqlconfig.yml, correct?

In the typescript boilerplate, the schema path is hardcoded:

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers,
  context: req => ({
    ...req,
    db: new Prisma({
      endpoint: '__PRISMA_ENDPOINT__', // the endpoint of the Prisma DB service
      secret: 'mysecret123', // specified in database/prisma.yml
      debug: true, // log all GraphQL queries & mutations
    }),
  }),
})

You need to adjust the typeDefs property.

Ahhhh, my fault. Of course! :)

Not a bug, closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MitkoTschimev picture MitkoTschimev  路  3Comments

marktani picture marktani  路  3Comments

marktani picture marktani  路  3Comments

Fi1osof picture Fi1osof  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments