ardatan / graphql-import

Import & export definitions in GraphQL SDL
868 stars 56 forks source link

Unable to find any GraphQL type definitions #512

Closed dkvilo closed 4 years ago

dkvilo commented 4 years ago

if you are using babel-node or babel CLI to build the source and you have the following folder structure error occurs

log

Works fine for following

JexPY commented 4 years ago

Any updates?

ChrisFieldsII commented 4 years ago

I was able to get around this by using an absolute path with path.join(__dirname, 'schema.graphql'). My directory doesn't look exactly like yours but hopefully switching to absolute path fixes problem for now

dkvilo commented 4 years ago

I was able to get around this by using an absolute path with path.join(__dirname, 'schema.graphql'). My directory doesn't look exactly like yours but hopefully switching to absolute path fixes problem for now

Hello, Yes, I tried this approach before submitting the issue but wasn't working with my dir structure. finally, I end up with coping the .graphql files to the dist folder.

"build": "babel src -d vendor && ncp src/graphql/schema.graphql vendor/graphql/schema.graphql"

davidsonsns commented 4 years ago

@ChrisFieldsII's solution worked well here. Thks!

ardatan commented 4 years ago

When you run graphql-import from your dist/ directory, it throws that error because you don't have those graphql files in your dist/ directory. What you need to do is to move graphql files as suggested above.