Loading a graphql schema

As an absolute beginner, I am attempting to build a graphql api. What I’d like to do next is load, parse and use an actual graphql schema file, but it seems that accessing another file from a lambda function is somewhat convoluted. fs.readFileSync fails, and trying to bundle fs doesn’t help. I also used __dirname + '/schema.graphql' to fix the path, to no avail. What else am I missing to make this work?

If you want to use GraphQL then have a look at AppSync before you build a custom GraphQL server using Lambda.

1 Like

Checking it out now and it seems promising, thanks. But the question still stands as I wonder how to access a static file.