• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

99designs / gqlgen / 10929653265

18 Sep 2024 08:29PM UTC coverage: 58.813% (-0.7%) from 59.525%
10929653265

push

github

web-flow
feat: create @requires integration that functions like a normal resolver (#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

215 of 470 new or added lines in 10 files covered. (45.74%)

1 existing line in 1 file now uncovered.

7404 of 12589 relevant lines covered (58.81%)

509.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.01
/codegen/data.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc