Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ts] Type 'string' is not assignable to type 'DocumentNode | DocumentNode[]'. #15

Closed
aadrew opened this issue Oct 22, 2018 · 3 comments
Closed

Comments

@aadrew
Copy link

aadrew commented Oct 22, 2018

I'm guessing this is due to changes in apollo-server-express since you published? If I google, I can find several workarounds, but I am interested in how you would solve this. Thanks!

@eveporcello
Copy link
Contributor

eveporcello commented Oct 23, 2018

Hi @aadrew - have you found a workaround for this yet? I haven't set up the server with TypeScript before so haven't encountered this error.

Maybe try importing gql from apollo-server-express and wrap the import with gql?

const { ApolloServer, gql } from 'apollo-server-express'
var typeDefs = gql(readFileSync('./typeDefs.graphql', 'UTF-8'))

@aadrew
Copy link
Author

aadrew commented Oct 23, 2018

Thank you, @eveporcello. The workaround I found was exactly your solution. Sorry I didn't update this issue earlier. Thank you for your response. It's good to know we came to the same solution.

@aadrew aadrew closed this as completed Oct 23, 2018
@eveporcello
Copy link
Contributor

awesome! glad that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants