- How do I install player259/graphql-bundle in a Symfony project?
- Install it with Composer using composer require player259/graphql-bundle, then enable the bundle in your Symfony kernel or config/bundles.php. It pulls in the webonyx/graphql-php library, which handles GraphQL parsing and execution. Check the README for the exact service configuration and route setup for your Symfony version.
- Does player259/graphql-bundle work with Laravel?
- No. It is a Symfony bundle that relies on Symfony's dependency injection, kernel, and routing, so it does not provide a Laravel service provider or facade. Laravel teams should use Laravel-native options such as rebing/graphql-laravel or Lighthouse instead. You could borrow ideas from it, but installing it directly in Laravel is not supported.
- What PHP and Symfony versions does player259/graphql-bundle support?
- Support depends on the bundle's composer.json constraints, which list the required PHP version and symfony/* package ranges. Because the package has seen little recent activity, verify those constraints against your current Symfony and PHP versions before installing. If your project uses a modern Symfony release, test compatibility in a branch first.
- How do I define a GraphQL schema with this bundle?
- You define types and fields using graphql-php's type system, then wire them into the bundle's configuration so it can build the executable schema. The bundle's job is to expose that schema through a Symfony controller or route rather than to replace graphql-php's schema API. See the README for the expected config structure and service IDs.
- Can I implement GraphQL mutations and subscriptions with player259/graphql-bundle?
- Mutations work because they are part of the graphql-php schema and execution model, so you define them like any other field with input types and resolvers. Subscriptions need a separate real-time transport such as WebSockets or Mercure, which this bundle does not provide out of the box. For subscriptions you would add your own transport and hook it into graphql-php's subscription support.
- How do I test GraphQL queries in a Symfony app using this bundle?
- Use Symfony's WebTestCase or KernelTestCase to boot the kernel and send POST requests with a GraphQL query payload to your endpoint, then assert on the JSON response. Unit test individual resolvers and type definitions separately so failures are easier to isolate. For schema validation, run graphql-php's schema validation utilities in a test case.
- Is player259/graphql-bundle actively maintained?
- The repository shows limited recent activity, so treat it as a lightweight, possibly stale integration rather than an actively developed product. Check the GitHub commit history, open issues, and releases before committing to it. For long-lived projects, compare it with better-maintained bundles like overblog/graphql-bundle or API Platform's GraphQL support.
- What are good alternatives to player259/graphql-bundle?
- For Symfony, overblog/graphql-bundle and API Platform's GraphQL component are more actively maintained and offer schema generation, pagination, and security integrations. For Laravel, Lighthouse and rebing/graphql-laravel are the common choices. Plain webonyx/graphql-php with a small custom controller is also viable if you only need a minimal endpoint.
- How do I add authentication and authorization to GraphQL resolvers with this bundle?
- Protect the GraphQL route with Symfony's security firewall, then check user roles or tokens inside resolvers or graphql-php field middleware. Because GraphQL often uses a single endpoint, per-field authorization matters more than route-level rules. Avoid leaking sensitive errors by customizing graphql-php's error formatting.
- Is player259/graphql-bundle production-ready?
- It is a thin integration layer, so production readiness depends on how you configure graphql-php and Symfony around it. Add query depth and complexity limits, disable introspection in production if appropriate, and cache parsed schemas. Also review the package's maintenance status and pin a tested version in composer.lock.