Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphQLSchema Empty After Upgrading to Serverless Framework v4 #648

Open
ugurhicyilmam opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@ugurhicyilmam
Copy link

After upgrading from Serverless Framework v3.x to v4, the serverless-appsync-plugin is encountering an issue where the graphQLSchema is empty upon deployment. Reverting to v3.x resolves the problem, indicating a potential compatibility issue between the plugin and the latest version of the Serverless Framework.

Steps to Reproduce:

  • Upgrade Serverless Framework to version 4.x (tested on versions ranging from 4.3.3 to 4.4.18).
  • Deploy a service configured with serverless-appsync-plugin and a defined GraphQL schema.
  • Observe that the deployed AppSync API has an empty schema, and deployment fails with an error: "Definition cannot be empty."

Expected Behavior:
The GraphQL schema should deploy correctly, as it does with Serverless Framework v3.x.

Actual Behavior:
The deployed AppSync API has an empty graphQLSchema, and deployment fails with the error mentioned above.

What I’ve Tried:

  • Tested with multiple Serverless Framework v4 versions, from 4.3.3 to 4.4.18 (latest), with no success.
  • Test with multiple serverless-appsync versions from 2.7.0 to 2.9.1, with no success.
  • Simplified the GraphQL schema to the following minimal example:
type Mutation {
    addTodo(pk: String!, input: TodoInput!): ToDo!
}


type Query {
    getTodo(pk: String!, sk: String!): ToDo
}

type ToDo {
    pk: String!
    sk: String!
    val: String!
}

input TodoInput {
    val: String!
}

The issue persists even with this simple schema.
Simplified the configuration to the bare minimum:

custom:
  appSync:
    name: 'api'
    schema: 'schema.graphql'
    authentication:
      type: 'AMAZON_COGNITO_USER_POOLS'
      config:
        userPoolId:
          Ref: 'CognitoUserPool'

The issue persists with this minimal configuration.
Validated the schema using the validate-schema command, which works fine without errors.
Checked the generated package; the schema definition is missing, indicating it is not being bundled correctly during deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant