I am using Apollo Android GraphQL (Gradle plug-in version 1.2.1) to post data to a server. I have downloaded the schema.json file from the server and written a .graphql file with a mutation. To pass objects from the App I defined some input objects as follows.
input Location {
lat: Float!
lon: Float!
}
input SensorParams {
sources: [Int]
exposition: Float
location: Location!
}
mutation InsertSessionResults(
$location: Location!) {
insertSession(session: {
name: $name
}) {
id
}
}
However when I build the App, I get the following error: Failed to parse GraphQL file. Unsupported token '!'
If I remove the '!' from Location, the process gives the same error for the '[' char.
Reading the doc I understand that both characters are allowed in input definition to request a non-null value and to set a list type respectively, so what may cause the error?