You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwGraphQLError("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
The text was updated successfully, but these errors were encountered:
Because @include(if: $withFriends) affects which data is acceptable to pass in as jsonObject, the executor needs to know the value of the withFriends variable. So it seems init(jsonObject:) should take an optional variables: parameter, which it can pass through to GraphQLExecutor#execute.
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
The text was updated successfully, but these errors were encountered: