bkegley / intro-to-graphql-meetup

Slides for SFDevs Meetup
2 stars 0 forks source link

Netlify deploy setting #7

Open peter-wd-1 opened 4 years ago

peter-wd-1 commented 4 years ago

Hi, I love this project and great intro for graphql with Apollo! Is it deployable on Netlify? I've been trying to test your code(especially gateway) but It seems I need to setup netlify.toml to run the functions. Would you be able to share how this function has been set up for deploying on Netlify? Were you using netlify-lambda?

peter-wd-1 commented 4 years ago

I'm getting an error when I build with netlify-lambda,

ERROR in ./src/functions/federated-graphql-simple/schema.graphql
Module parse failed: Unexpected token (1:5)
You may need an appropriate loader to handle this file type.
| type Person @key(fields: "id") {
|   id: ID!
|   firstName: String
 @ ./src/functions/federated-graphql-simple/federated-graphql-simple.js 27:15-42

Did you get this error by any chance?

here is my root package.json

 "scripts": {
        "start": "run-p start:**",
        "start:lambda-simple": "netlify-lambda serve src/functions/federated-graphql-simple -p 9002",
        "start:lambda-pokemon": "netlify-lambda serve src/functions/federated-graphql-pokemon -p 9001",
        "start:lambda-gateway": "netlify-lambda serve src/functions/graphql-gateway",
        "build": "run-p build:**",
        "build:lambda-simple": "netlify-lambda build src/functions/federated-graphql-simple",
        "build:lambda-pokemon": "netlify-lambda build src/functions/federated-graphql-pokemon",
        "build:lambda-gateway": "netlify-lambda build src/functions/graphql-gateway",
        "test": "react-scripts test --env=jsdom",
        "eject": "react-scripts eject"
    }