Hi guys! I'm getting an error when trying to use a...
# help
c
Hi guys! I'm getting an error when trying to use an existing Api Gateway inside a different serverless.yml:
ApiGatewayRestApi - 1 validation error detected: Value null at 'createRestApiInput.name' failed to satisfy constraint: Member must not be null
Has anyone of you seeing a similar error?
I'm defining the rest api inside the provider section:
Copy code
apiGateway:
    restApiId: aaa
    restApiRootResourceId: bbb
o
I’m using that syntax and its working - where and how do you define those values?
I’m guessing one or both of them is not defined
c
I was first exporting the values from the other serverless.yml (the one creating the API gateway)
but I have also tried hardcoding the values
o
Is it sls or CF complaining?
c
sls, but I think the problem is that I'm using the api gateway ref somewhere else, give me one sec to check this
o
If its CF you can check the template that got generated
a
I have actually just now been experimenting with using apollo-server-lambda with the sst. I ran into this issue: https://github.com/apollographql/apollo-server/issues/414 If I understand this correctly, it looks like apollo-server-lambda doesn't support api gateway v2, which the sst uses. @Frank is there any way to make the function use PayLoadFormatVersion 1? ref: https://github.com/apollographql/apollo-server/issues/414#issuecomment-685416157
f
@Andreas I can try putting in support for it tmr. Does that work for you timeline wise?
a
@Frank Sure! And, btw thanks for all the hard work you're putting in. I have been developing with the sst for about a week now, and I'm really enjoying it!
f
😁 Trying to get SST to a spot where most common use cases are handled. Can’t get their without your help!
@Andreas Added payload format version in 0.9.11 To update:
Copy code
$ npm install --save --save-exact @serverless-stack/cli@0.9.11 @serverless-stack/resources@0.9.11
And it can it in your `sst.Api`:
Copy code
new Api(this, "Api", {
  defaultPayloadFormatVersion: ApiPayloadFormatVersion.V1,
  routes: {..}
});