- What is laragraph/utils used for?
- It provides basic utilities for building GraphQL servers with Laravel, including request parsing and batch request handling. It is not a full GraphQL framework; it supplies lower-level building blocks used by higher-level packages. Use it with Lighthouse for SDL-first development or graphql-laravel for code-first development.
- How do I install laragraph/utils?
- Install it with Composer by running composer require laragraph/utils. For production, pin a constraint such as ^2.3.2 so patch-level hardening fixes are not silently downgraded by a future update. Then update your lockfile and run your GraphQL contract and integration tests.
- Does laragraph/utils work with Lighthouse?
- Yes, Lighthouse is a recommended SDL-first framework that integrates the primitives in this package. Lighthouse may already pull laragraph/utils in transitively, so check your lockfile to confirm. If it is transitive, make sure the resolved version includes the v2.3.2 batch rejection fix.
- Does laragraph/utils support graphql-laravel code-first development?
- Yes, graphql-laravel is listed as the recommended code-first framework for using these utilities. Laragraph/utils is not a replacement for graphql-laravel or Lighthouse; it is a shared utility layer. Use the framework for schema and resolver structure, and this package for underlying GraphQL request handling.
- What Laravel and PHP versions does laragraph/utils support?
- The README excerpt does not list Laravel or PHP version constraints. Check the package composer.json on Packagist and in the repository to confirm the supported matrix. Verify those constraints against your application's PHP and Laravel versions before adopting the update.
- What changed in laragraph/utils v2.3.2?
- v2.3.2 is a patch release that rejects JSON and multipart bodies parsed as a batch containing non-object entries. Previously such input could raise a TypeError, which is a 500-class failure on user-supplied input. This is a hardening fix for malformed-input paths and is worth taking quickly if your GraphQL endpoint is internet-facing.
- Does laragraph/utils register a service provider or config file?
- The provided README excerpt describes basic utilities and does not document a service provider or configuration file. It may be purely static utility classes, but confirm by reading the source and namespace layout. Check for PSR-4 conventions and any Laravel package auto-discovery entry in composer.json.
- How should I test the v2.3.2 malformed batch request fix?
- Run your GraphQL contract and integration suite after updating. Add tests that POST malformed JSON and multipart batch bodies containing non-object entries. Assert that the endpoint returns a 4xx-class, well-formed error rather than a 500. Also exercise the real endpoint through your edge or CDN layer in staging.
- What response should a rejected GraphQL batch body return?
- The v2.3.2 release tightens parsing so malformed batch entries are rejected instead of raising a TypeError. Confirm whether your application returns a plain HTTP 400 or a GraphQL-formatted error, and ensure that matches your API contract. Verify the behavior for both JSON and multipart bodies, since multipart batch handling is the less commonly exercised path.
- Is laragraph/utils actively maintained, and what are the alternatives?
- The maintainer footprint appears small, so weigh bus factor and long-term maintenance for your project. The repository shows CI and codecov badges, and releases are tracked through pull requests. Alternatives are full frameworks such as Lighthouse and graphql-laravel, which build on these utilities rather than replacing them.