I can confirm it works when explicitly passing the...
# prisma-whats-new
w
I can confirm it works when explicitly passing the values via variables
a
In the Playground, this also works as expected, so it's not a server-side problem
And what do you mean by 'ignored'?
d
I think he means that it is not using the values he is setting as defaults.
a
Well, then which values is the query using, if your not passing variables, and the defaults seem to be ignored...
w
works in the playground for me too
d
Maybe the issue is in the parsing of the query?
w
where would that be?
a
Can you check the network tab to see the actual query your client is firing?
w
yep 1 sec
is it because they are being sent as null?
I’m not specifying that anywhere
a
How are you sending the query?
w
with Apollo - 1 sec I can get that code
const itemsEnahncer = graphql(ALL_ITEMS_QUERY, { name: 'allItemsQuery' });
export default compose(itemsEnahncer, deleteItemEnhancer)(ItemList)
a
Hmmm...
apollo-client
supports default values, where are you passing in the variables object?
w
I’m not passing a variables object at all
a
Then what's the use of defining variables?
w
which is weird that they are being passed by null. I can confirm passing null in the playground causes the same issue
later on I might pass a variable, but if I don’t pass variables I want defaults to kick in
a
It's impossible to say without seeing more of the code. Could you create a post on the forum? https://www.graph.cool/forum/
w
If I explicitly pass undefined they kick in
I tihnk this is an apollo issue - graphql is working as expected
ill take it over to their chat
👍🏻 1
a
Glad we could rule graphcool out 😄
Do me a favor, update this thread if you get an answer from them, I'd like to know how this is supposed to work too.
pretty sure it’s supposed to work like ES6 default values do - omitting or explicit undefined are the only two things that should cause the default values to kick in
a
Yes, I agree
Found this for you, don't know if it's 100% related though: https://github.com/apollographql/apollo-client/issues/852#issuecomment-257037765