Skip to content
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

Merged
merged 21 commits into from
Apr 22, 2021
Merged

Conversation

trevor-scheer
Copy link
Member

@trevor-scheer trevor-scheer commented Apr 13, 2021

@glasser
Copy link
Member

glasser commented Apr 14, 2021

is this looking for review yet?

@trevor-scheer
Copy link
Member Author

@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.

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.
federation-js/src/joinSpec.ts Outdated Show resolved Hide resolved
federation-js/src/joinSpec.ts Outdated Show resolved Hide resolved
federation-js/src/joinSpec.ts Outdated Show resolved Hide resolved
federation-js/src/joinSpec.ts Outdated Show resolved Hide resolved
federation-js/src/joinSpec.ts Outdated Show resolved Hide resolved
@@ -200,6 +200,10 @@ function mergeFieldNodeSelectionSets(
(node): node is FieldNode => node.kind === Kind.FIELD,
);

// Committed by @trevor-scheer but authored by @martijnwalraven
Copy link
Member

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.

@glasser
Copy link
Member

glasser commented Apr 19, 2021

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.
Copy link
Member

@abernix abernix left a 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}}`);
Copy link
Member

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:

#679

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.

@trevor-scheer
Copy link
Member Author

Captured incomplete work in separate issues #683 #684

@trevor-scheer trevor-scheer enabled auto-merge (squash) April 22, 2021 20:47
@trevor-scheer trevor-scheer merged commit d20d6f9 into main Apr 22, 2021
@trevor-scheer trevor-scheer deleted the trevor/redux-followups branch April 22, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants