Following #51, I am trying to create a GraphQLSelectionSet via init(jsonObject: JSONObject)
The query I'm testing has a non-optional parameter 'Episode'
query Hero($episode: Episode, $withFriends: Boolean!) {
hero(episode: $episode) {
name
friends @include(if: $withFriends) {
name
}
}
}
and to JsonObject I'm passing is
{
"data": {
"hero": {
"__typename": "Droid",
"name": "R2-D2",
"friends": [{
"__typename": "Human",
"name": "Luke Skywalker"
}, {
"__typename": "Human",
"name": "Han Solo"
}, {
"__typename": "Human",
"name": "Leia Organa"
}]
}
}
}
The call fails in GraphQLExecutor.swift
|
throw GraphQLError("Variable \(booleanCondition.variableName) was not provided.") |
The error is "Variable withFriends was not provided". The variable info: GraphQLResolveInfo was never populated because the init method calls executor.execute without specifying the variables field, which is nil by default.
Should we skip validation of input parameters when calling this method? If so, which would be the recommended way?
Thanks,
Diego
Following #51, I am trying to create a GraphQLSelectionSet via init(jsonObject: JSONObject)
The query I'm testing has a non-optional parameter 'Episode'
query Hero($episode: Episode, $withFriends: Boolean!) {
hero(episode: $episode) {
name
friends @include(if: $withFriends) {
name
}
}
}
and to JsonObject I'm passing is
{
"data": {
"hero": {
"__typename": "Droid",
"name": "R2-D2",
"friends": [{
"__typename": "Human",
"name": "Luke Skywalker"
}, {
"__typename": "Human",
"name": "Han Solo"
}, {
"__typename": "Human",
"name": "Leia Organa"
}]
}
}
}
The call fails in GraphQLExecutor.swift
apollo-ios/Sources/Apollo/GraphQLExecutor.swift
Line 165 in 0928061
The error is "Variable withFriends was not provided". The variable info: GraphQLResolveInfo was never populated because the init method calls executor.execute without specifying the variables field, which is nil by default.
Should we skip validation of input parameters when calling this method? If so, which would be the recommended way?
Thanks,
Diego