graphql-laravel icon indicating copy to clipboard operation
graphql-laravel copied to clipboard

Make fields of root types lazy

Open sforward opened this issue 1 year ago • 0 comments

Summary

This makes the fields of the Query and Mutation root types lazy, so they aren't all initialized anymore on every request. Names are required in the schema config to apply this performance benefit, for example:

    'query' => [
        'example' => ExampleQuery::class,
    ],

Type of change:

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update
  • [x] Misc. change (internal, infrastructure, maintenance, etc.)

Checklist:

  • [x] Existing tests have been adapted and/or new tests have been added
  • [x] Add a CHANGELOG.md entry
  • [ ] Update the README.md
  • [x] Code style has been fixed via composer fix-style

sforward avatar Sep 12 '23 07:09 sforward