-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: typescript-redux
followups
#656
Conversation
is this looking for review yet? |
@glasser you're welcome to, but can also wait til I've addressed the other line items. I'd lean towards just waiting unless you're looking for something to do. |
…dCharacters from graphql-js
Validate their definition length === 1. Also: * Update sibling fns in all 3 packages and add a note stating their existence in other places. * Remove extraneous 'query' in parsing function
This didn't make sense. Rather than falling back to something that isn't correct, we should just assert the existence of the thing that is expected to always be there.
8987755
to
fb0f6e9
Compare
@@ -200,6 +200,10 @@ function mergeFieldNodeSelectionSets( | |||
(node): node is FieldNode => node.kind === Kind.FIELD, | |||
); | |||
|
|||
// Committed by @trevor-scheer but authored by @martijnwalraven |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @martijnwalraven might be interested in looking over these comments and making sure they fully capture what he wants, but that could be after this PR merges.
Made it through all the commits. Have a number of small comments. Confirmed that all the things you checked off on the checklist are addressed (modulo my comments). |
Also move some generic utils out of the composition utils file and into their own tiny files in a utilities folder. This more closely matches the structure of the gateway's code as well.
385dc02
to
e55c683
Compare
e55c683
to
f85a597
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks real good. Thanks for the thorough follow-through and clarity here!
(Agree with opportunity to use apollo-graphql
for some utilities – which I recently consolidated some into from apollo-env
, but I'm also comfortable with the duplication of these super small specialized utilities since they're unlikely to drift.)
* @returns A parsed FieldSet | ||
*/ | ||
export function parseSelections(source: string): ReadonlyArray<SelectionNode> { | ||
const parsed = parse(`{${source}}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be an opportunity to provide a more useful error message in the case of errors vai this parseSelections
function, or possibly some specialized utility functions that produce valuable error messages in the event of parse
errors; I'm just going to put this on the same radar by linking to this:
e.g., perhaps a parseKeys
, parseRequires
, parseProvides
might wrap this, or perhaps this can take a param.
Just a suggestion, not asking for it in this PR.
Copying (mostly) from #624:
_1
[ ] change composition (and spec) to only allow one(Martijn: I don't believe this is what we want)@join__type
per graphundefined
from it and improve error messages in the places that this change makes not compileFieldSet
printWithReducedWhitespace
encouraging us to considerstripIgnoredCharacters
?