https://serverless-stack.com/ logo
#help
Title
# help
s

Stiofán Ó Lorcáin

05/11/2022, 7:14 AM
Hey everyone I have 2 questions about the
AppSyncApi
1. My company is requiring all resources in a stack to follow a particular structure. I know you added
stackName
to the StackProps to allow for this but it doesn't seem to propagate to the
AppSyncApi
, just wondering if there is a way to do this? 2. Is it possible to create a custom
graphqlUrl
? At the moment, it is readonly with no
set
method Thanks for any help 🙂
t

thdxr

05/11/2022, 2:12 PM
are you saying the automatically generated name for the appsync api isn't good?
s

Stiofán Ó Lorcáin

05/11/2022, 2:19 PM
It's a little restrictive. My company enforces a particular naming convention so having an automated name doesn't work. For things like
Lambdas
the name can be custom using the
stackName
property but it doesn't seem possible to do the same for an AppSync api
t

thdxr

05/11/2022, 2:20 PM
does this help:
Copy code
const api = new AppSyncApi(stack, "Api", {
    cdk: {
      graphqlApi: {
        name: "whatever"
      }
    },
  });
s

Stiofán Ó Lorcáin

05/11/2022, 2:27 PM
That worked 🙂
f

Frank

05/11/2022, 5:59 PM
Is it possible to create a custom
graphqlUrl
@Stiofán Ó Lorcáin do you mean using custom domain? Here’s an example https://docs.serverless-stack.com/constructs/AppSyncApi#custom-domains
s

Stiofán Ó Lorcáin

05/12/2022, 4:34 AM
Thanks 🙂 I didn't see that in the type definitions but this is exactly what I was looking for.