Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create @requires integration that functions like a normal resol…
…ver (#3292) * feat: create @requires integration that functions like a normal resolver The "explicit_requires" flag current generates the @requires resolver inside the execution context. It also doesn't use the normal resolver resolution process and adds a custom implementation that is always called, even if the field isn't requested. The new "computed_requires" flag looks for @requires directives and mutates the schema to add dynamic field arguments and directives that are used internally by gqlgen. These additional directives (@entityReference and @populateFromRepresentations) are runtime directives that "computed_requires" adds implementations for that enable us to fetch the correct data from the representations array and populated it into the dynamic argument for the @requires field. * Add mechanism for supporting statically provided directive implementations. * Get @populateFromRepresentations working * Add tests for computedrequires * Update documentation * Ensure everyone that should be is using version 2 * Fix linter issues
- Loading branch information