I’m getting this very unspecific error and I’m not...
# orm-help
d
I’m getting this very unspecific error and I’m not sure how to troubleshoot it. I’ve seen a few other people have had it and I’ve tried their solutions to no avail. /Users/me/Development3/my-api/node_modules/graphql/language/lexer.js:316 throw (0, _error.syntaxError)(source, pos, unexpectedCharacterMessage(code)); ^ GraphQLError: Syntax Error: Cannot parse the unexpected character “.”. Specifically, I was missing:
Copy code
- generator: graphql-schema
    output: ../src/generated/graphql-schema/
Now, I have /generated/schema.graphl and /generated/graphql-schema/prisma.graphql. I added this to my data model.graphql:
Copy code
# import User from '.,/../../database/datamodel.graphql'
I still get this error. Any further suggestions on what I can do to track down this issue?
d
In import, I can see a ., Is this a typo or copied from your actual file ?
How does your setup look like? Can you please share a minimal reproduction repository?
d
Hi, @divyendu. Thanks for the response. You are correct, that “,” was a typo. But even corrected I get this error. I’ll have to see if I can set up a minimal repo after work.
👍 1
@divyendu (or anyone else who can help), I created a minimal repo available here: https://github.com/darrindickey/my-api/tree/master
d
I think that apollo-server does not have native
graphql-import
integration like
graphql-yoga
and you need to use this manually to make the import syntax work: https://github.com/prisma/graphql-import
or you can also use
babel-plugin-import-graphql
if you want to use babel: https://www.apollographql.com/docs/react/recipes/babel.html#Using-babel-plugin-import-graphql
d
@divyendu Ah! OK, thanks. I wasn’t aware of that, being new to the GraphQL world and tools. Thanks so much. I’ll give the import a shot.
d
Cheers, happy to help 🙂