0

I want to create an action with the following input:

input PurchaseInput {
    user: UserInfo!
}

UserInfo is defined as an object:

type UserInfo {
  accessToken: String!
  userId: Int!
}

However Hasura doens't like this and returns a 400 on saving the action.

Is it possible to define custom input types in Hasura? I feel limited by String, Int, Float, Boolean etc.

f7n
  • 1,476
  • 3
  • 22
  • 42

1 Answers1

0

You can absolutely create custom types like in your example

type UserInfo {
 accessToken: String!
 userId: Int!
}

So the error is of some other origin ( action response.... ).

Hasura only has a limitation of nested object types, for example, you can not do type definition like this in action :

type User {
 userId: Int!
}

type UserInfo {
 accessToken: String!
 user: User!
}
  • Thanks, this is more or less the answer, but I had to define nested `Input` types, I thought an action was limited to one Input type. – f7n Nov 30 '21 at 08:44