Custom type does not exist for Hasura Action #8655
Answered
by
nomocas
kevinmichaelchen
asked this question in
Question
-
Versionshasura version
INFO hasura cli version=v2.6.0
INFO hasura graphql engine endpoint="http://localhost:8080" version=v2.6.2 ReproI'm trying to create the following query: type Query {
distanceMatrix (arg1: DistanceMatrixInput): MatrixOutput
} With the following Input type: # Declare New Types
input DistanceMatrixInput {
origins: [LatLng]
destinations: [LatLng]
} These global types already exist: # Declared Global Types
type LatLng {
lat: Float!
lng: Float!
}
type MatrixOutput {
rows: [MatrixElementsRow!]
}
type MatrixElementsRow {
elements: [MatrixElement!]
}
type MatrixElement {
status: String
duration: Int!
durationInTraffic: Int
distance: Int!
} ErrorThis fails, complaining that
Why?Why would it say Temporary SolutionTemporarily, I can switch to something like: input DistanceMatrixInput {
originLats: [Float!]!
originLngs: [Float!]!
destinationLats: [Float!]!
destinationLngs: [Float!]!
} But this isn't ideal. |
Beta Was this translation helpful? Give feedback.
Answered by
nomocas
Mar 9, 2023
Replies: 1 comment
-
Hello @kevinmichaelchen, Maybe a little bit late, but the solution is to use input LatLng {
lat: Float!
lng: Float!
}
input DistanceMatrixInput {
origins: [LatLng]
destinations: [LatLng]
} And of course, don't forget to declare LatLng as an input in your Cheers. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kevinmichaelchen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @kevinmichaelchen,
Maybe a little bit late, but the solution is to use
input
nesting in your case.And of course, don't forget to declare LatLng as an input in your
actions.yaml
.Cheers.