Skip to content

Conversation

@wawhal
Copy link
Contributor

@wawhal wawhal commented Apr 20, 2020

Description

This is an experiemental PR trying to optimise the init queries on console.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System
  • Tests
  • Other (list it)

@wawhal wawhal added s/do-not-merge Do not merge this pull request to master c/console Related to console no-changelog-required labels Apr 20, 2020
@netlify
Copy link

netlify bot commented Apr 20, 2020

Deploy preview for hasura-docs ready!

Built with commit 98c0c87

https://deploy-preview-4489--hasura-docs.netlify.app

@wawhal
Copy link
Contributor Author

wawhal commented Apr 20, 2020

/heroku deploy

@hasura-bot
Copy link
Contributor

Review app for commit 2dce0e8 deployed to Heroku: https://hge-ci-pull-4489.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4489-2dce0e8a

@hasura hasura deleted a comment from wawhal Apr 21, 2020
@arvi3411301
Copy link
Member

/heroku deploy

@hasura-bot
Copy link
Contributor

Review app for commit 60fee15 deployed to Heroku: https://hge-ci-pull-4489.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4489-60fee15b

@hasura-bot
Copy link
Contributor

Review app for commit 98c0c87 deployed to Heroku: https://hge-ci-pull-4489.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4489-98c0c87b

hasura-bot pushed a commit that referenced this pull request May 27, 2022
### Description

The main goal of this PR is, as stated, to remove the circular dependency in the schema building code. This cycle arises from the existence of remote relationships: when we build the schema for a source A, a remote relationship might force us to jump to the schema of a source B, or some remote schema. As a result, we end up having to do a dispatch from a "leaf" of the schema, similar to the one done at the root. In turn, this forces us to carry along in the schema a lot of information required for that dispatch, AND it forces us to import the instances in scope, creating an import loop.

As discussed in #4489, this PR implements the "dependency injection" solution: we pass to the schema a function to call to do the dispatch, and to get a generated field for a remote relationship. That way, this function can be chosen at the root level, and the leaves need not be aware of the overall context.

This PR grew a bit bigger than that, however; in an attempt to try and remove the `SourceCache` from the schema altogether, it changed a lot of functions across the schema building code, to thread along the `SourceInfo b` of the source being built. This avoids having to do cache lookups within a given source. A few cases remain, such as relay, that we might try to tackle in a subsequent PR.

PR-URL: hasura/graphql-engine-mono#4557
GitOrigin-RevId: 9388e48372877520a72a9fd1677005df9f7b2d72
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Rishichandra Wawhal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/console Related to console no-changelog-required s/do-not-merge Do not merge this pull request to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants