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

Change internals to communicate via Documents and context #617

Closed
stubailo opened this issue Sep 2, 2016 · 3 comments
Closed

Change internals to communicate via Documents and context #617

stubailo opened this issue Sep 2, 2016 · 3 comments

Comments

@stubailo
Copy link
Contributor

stubailo commented Sep 2, 2016

Right now, we have special methods that read fragments and selection sets from the store, and we also have a special data type for fragment maps, rootId, etc. I think in order to comply with our own design principles, we should simplify the interfaces between different modules, and as much as possible communicate via GraphQL Document objects.

Here's the proposal:

  1. Remove FragmentMap entirely, and simply attach any necessary fragments to a GraphQL Document. Use graphql-anywhere to automate fragment handling so that our code never has to deal with fragment maps again.
  2. Deprecate the readFragmentFromStore method, and replace it with a special query. A good option could be to use the Relay-style node(id: ...) query, and treat that specially as a read for the object in the store with that dataId.
  3. Communicate all other options by attaching them to a context object as proposed by Pass a context object around with store data #377, which happens to be built into graphql-anywhere.

I'm game to implement this as part of a move to graphql-anywhere, if #615 is also desired.

I believe these changes will dramatically simplify the code.

@stubailo stubailo added the idea label Sep 2, 2016
@stubailo stubailo mentioned this issue Sep 29, 2016
@stubailo stubailo modified the milestone: New API/Refactor Sep 29, 2016
@helfer
Copy link
Contributor

helfer commented Oct 14, 2016

I think we've made some good progress on this front. Let's look at it again and see what we still want to do before closing this issue!

@stubailo
Copy link
Contributor Author

We've done a fair bit, going to remove from milestone

@stubailo stubailo removed this from the Release 0.5 milestone Oct 15, 2016
@helfer
Copy link
Contributor

helfer commented Dec 5, 2016

I think we're pretty much done here. Fragments will be completely removed in 0.6

@helfer helfer closed this as completed Dec 5, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants