Build failing with typescript
See original GitHub issueHi guys,
Any idea why this fails to compile? I followed all the guidelines correctly. Server works in dev mode.
Code for the line 44:
// ...
const db: Prisma = new Prisma(prismaOptions)
const typeDefs = importSchema('app-schema.graphql')
const schema = makeExecutableSchema({typeDefs, resolvers})
const server = new GraphQLServer({
schema,
directiveResolvers: directiveResolvers,
context: req => {
return {
...req,
db,
}
},
})
Build failed output:
$ rimraf dist && tsc --pretty
src/index.ts:40:34 - error TS2345: Argument of type '{ schema: GraphQLSchema; directiveResolvers: { isAuthenticated: (next: any, source: any, args: an...' is not assignable to parameter of type 'Props'.
Types of property 'schema' are incompatible.
Type 'GraphQLSchema' is not assignable to type 'GraphQLSchema'. Two different types with this name exist, but they are unrelated.
Types of property 'astNode' are incompatible.
Type 'SchemaDefinitionNode' is not assignable to type 'SchemaDefinitionNode'. Two different types with this name exist, but they are unrelated.
Types of property 'loc' are incompatible.
Type 'Location' is not assignable to type 'Location'. Two different types with this name exist, but they are unrelated.
Types of property 'startToken' are incompatible.
Type 'Token' is not assignable to type 'Token'. Two different types with this name exist, but they are unrelated.
Types of property 'prev' are incompatible.
Type 'Token' is not assignable to type 'Token'. Two different types with this name exist, but they are unrelated.
40 const server = new GraphQLServer({
~
41 schema,
~~~~~~~~~
...
48 },
~~~~
49 })
~
thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Typescript build failure - visual studio 2013 - Stack Overflow
I'm currently having two projects with typescript 1.1 that are opened in visual studio 2013 with typescript 1.8 installed. VS asks to upgrade...
Read more >Build fails due to a Typescript Error - Build/Test Issues
The root issue is that your typescript build step requires certain files to be present on paths relative to the solution being compiled....
Read more >Mongoose 6.1.5 typescript build fail · Issue #11180 - GitHub
My build is failing after updating mongoose to 6.1.5 but it was working fine in 6.1.4 If the current behavior is a bug,...
Read more >Documentation - Integrating with Build Tools - TypeScript
Right-Click -> Manage NuGet Packages · Search for Microsoft.TypeScript.MSBuild · Hit Install · When install is complete, rebuild!
Read more >build definition started to fail on typescript webpack operation
I have a prebuild step of running webpack, which compiles the typescript code and creates a set of packed javascript files. This step...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t know this is same for everyone else, but after I added
yarn add --dev @types/graphql
everything works fine for meI’m having similar issue with
IResolver
. My project compiles if I modify it but appending| any
atInterface.d.ts
definition. (I’m breaking the type checking like other cited solutions)