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

The field input type 'ModelSortDirection' is not present when resolving type 'Query' #6029

Closed
hisham opened this issue Dec 1, 2020 · 1 comment · Fixed by #6033
Closed
Labels
bug Something isn't working graphql-transformer-v1 Issue related to GraphQL Transformer v1 @key Issues tied to @key transformer directive

Comments

@hisham
Copy link
Contributor

hisham commented Dec 1, 2020

Describe the bug
Creating a secondary key on a model with no list query results in this error on amplify push:

UPDATE_FAILED GraphQLSchema AWS::AppSync::GraphQLSchema Tue Dec 01 2020 14:37:57 GMT-0700 (Mountain Standard Time) Schema Creation Status is FAILED with details: Found 2 problem(s) with the schema: The field input type 'ModelSortDirection' is not present when resolving type 'Query' [@185:1]. The field input type 'ModelTodoFilterInput' is not present when resolving type 'Query' [@185:1].

This is I think similar to the issues reported at #2389

Amplify CLI Version
4.37.0

To Reproduce

Push a model like so:

type Todo
  @model(
    queries: { get: "getTodo" }
    mutations: {
      create: "createTodo"
      update: "updateTodo"
      delete: "deleteTodo"
    }
    subscriptions: null
  )
  @key(
    name: "ByTicketId"
    fields: ["ticketId"]
    queryField: "todosByTicketId"
  )
  @auth(rules: [{ allow: private, provider: iam }]) {
  id: ID!
  ticketId: Float
}

You'll get the error. Removing queries: { get: "getTodo" } will make things work.

Expected behavior
Should just work without me having to remove queries: { get: "getTodo" }.

SwaySway added a commit to SwaySway/amplify-cli that referenced this issue Dec 2, 2020
add ModelSortDirection and ModelXFilterInput if they don't exist in the schema (ex. list query is
null)

re aws-amplify#6029
@SwaySway SwaySway added @key Issues tied to @key transformer directive bug Something isn't working graphql-transformer-v1 Issue related to GraphQL Transformer v1 labels Dec 2, 2020
SwaySway added a commit that referenced this issue Dec 11, 2020
add ModelSortDirection and ModelXFilterInput if they don't exist in the schema (ex. list query is
null)

re #6029
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working graphql-transformer-v1 Issue related to GraphQL Transformer v1 @key Issues tied to @key transformer directive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants