-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add executeExchange for using an executable schema #474
Conversation
I think @mxstbr is already maintaining a package for that. We may just want to send a PR to update it a little https://github.com/mxstbr/urql-exchange-schema |
Happy to merge that into core! |
Let me know what you want to do 👍 |
💥 No ChangesetLatest commit: 91100da Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
@JoviDeCroock @andyrichardson assuming we'll want to get this merged soon, but we'll only need some minor documentation for this after a rebase, and let's stick it into a new |
@kitten Yeah I'm happy to sort that out but you're going to have to explain the monorepo to me. The exchange is 61 lines, no new dependencies, and will be tree shaken if not in use. Do we want this exchange to be a standalone package in Also, where do the docs for standalone packages go? |
I think bundling an exchange would only make sense if a majority of users use it? Although, I can totally see an exchange being "moved" into core, when it crosses that threshold. For now, I'd play it safe. It looks like when I've got some docs in the |
@kitten thanks for the explanation - I've moved it to /exchanges |
fc1a5ae
to
5a34b9e
Compare
FWIW, this exchange fixed an issue I was experiencing with https://github.com/mxstbr/urql-exchange-schema, in that queries via SSR were being executed once for each exchange. So a typical set-up of: exchanges: [
dedupExchange,
cacheExchange,
ssr,
schemaExchange(schema, { context }),
] ... would actually run the query four times. This is a subtle bug that's easy to overlook, since the first query that's run is the one that winds up being rendered back to the client. Just a heads-up @mxstbr in case it made sense to update your own package while waiting for this to merge. |
To get this up-to-date we just need to make sure that the config files match ( |
… dependency versions.
The branch has been rebased on master and these files are matching the other extensions. A few other misc changes -- see commit log. |
… exchange's package.
…rn same data for same inputs.
About
Exchange for executing queries locally using an executable schema.
This may be particularly useful for us when making example projects as we could mock responses here rather than implementing a server.