GraphQL: DX Relational Where Query#6255
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6255 +/- ##
=========================================
- Coverage 94.01% 93.92% -0.1%
=========================================
Files 169 169
Lines 11529 11564 +35
=========================================
+ Hits 10839 10861 +22
- Misses 690 703 +13
Continue to review full report at Codecov.
|
|
Everything should be okay now 🚀 |
davimacedo
left a comment
There was a problem hiding this comment.
Great job! I have few comments.
| in: inOp(GraphQLString), | ||
| notIn: notIn(GraphQLString), | ||
| exists, | ||
| inQueryKey, |
There was a problem hiding this comment.
I think we should not remove these options from string, float, id, etc. With these options, the users are currently able to do something like:
countries(where: { continent: { inQueryKey: { query: { className: "Country", where: { name: { equalTo: "US" } } }, key: "continent" } } }) {
...
}There was a problem hiding this comment.
Hummm, from my point of view it's hard to understand this query without reading a documentation. The inQueryKey feature is interesting to implement but i think we need first to re-design the input before re-implementing this feature. 😄 ? like playing with Enum for key and className, but this is not the purpose of this PR... We need to avoid people using inputs that can be deprecated in a near futur 😄
There was a problem hiding this comment.
So I think it would be better keep it here while we don't improve. Someone can be already using this feature and they will have no alternative.
|
So, to avoid some confusion between regular I added support of Result: {
countries(
where: { companies: { haveNot: { name: { equalTo: "imACompany1" } }, } }
) {
edges {
node {
name
president {
name
}
companies {
edges {
node {
name
}
}
}
}
}
}
} |
|
Tests are okay (postgres tested with my local set up), just (again) a Postgres fail... |
|
@Moumouls great job with the I think persons(where: { spouse: { have: { name: { equalTo: "John" } } } }) { ... }But for relation is little bit strange to me: persons(where: { children: { have: { name: { equalTo: "John" } } } }) { ... }It looks to me that it should only return persons whose ALL children have name equal to "John". But that's not the case, right? I can't think a better name though. Maybe existWith? I am not good in giving names :) so if you prefer I am also okay in moving forward with the current ones. Another minor comment. For relation, it should probably be better countries(where: { companies: { exist: true } }) { ... } |
|
@dplewis Postgres tests are hanging in many branches. Sometimes it works for all of them then it stops working for all of them. I guess it is a Travis issue or at least some misconfiguration from our side... |
|
@davimacedo I opened a PR to address this. Hopefully it works |
|
@dplewis I'm not sure about logging, as it does not seem relevant to the Especially for the error related to writing something to a file. The library never writes anything to a file. |
|
@Moumouls The build should be good now. |
I think we will keep the |
|
Ok. No problem. Can you please only address my last open conversation and let's go to merge? |
|
Seems to have a random |
* DX Relational Where Query * Remove WherePointer & fix tests * Add have, haveNot, exists on Pointer/Relation where input * Merge branch 'master' into gql-relational-query * Enable inQueryKey * better descrption
Allow to execute complexe relational queries like:
Query: Find countries containing companies that contains at least one employee named "John"
This system works for
PointerandRelationParse fields