Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Graphql Laravel Package

youshido/graphql

A PHP GraphQL library for building schemas and executing queries with a type-safe, object-oriented API. Define types, fields, resolvers, and middleware in code, with support for input validation, custom scalars, and introspection for PHP apps.

View on GitHub
Deep Wiki
Context7

Pure PHP realization of GraphQL protocol

Frequently asked questions about Graphql
Is youshido/graphql compatible with Laravel 9/10 and PHP 8.1+?
The package was last updated in 2019 and may not support modern PHP/Laravel versions out of the box. You’ll need to manually address deprecated features (e.g., `create_function`, `extract`) and test compatibility. Consider forks like `graphql-php/graphql-php` for active maintenance.
How do I integrate GraphQL into Laravel routing?
Use `Route::graphql()` to define a GraphQL endpoint, then bind the schema to Laravel’s service container. Middleware (e.g., auth) works just like REST routes. Example: `Route::graphql('/graphql', ['middleware' => 'auth']);`
Does this library support GraphQL subscriptions?
No, this library focuses on queries and mutations. For subscriptions, explore alternatives like `graphql-php/graphql-php` or implement WebSocket-based solutions manually. Laravel’s built-in broadcasting may help with real-time features.
How does performance compare to alternatives like webonyx/graphql-php?
Performance depends on resolver complexity and schema size. This library lacks built-in optimizations like DataLoader, so you may need to implement batch loading manually. Benchmark against alternatives for your use case.
Can I use Eloquent models directly in resolvers?
Yes, the library integrates with Laravel’s Eloquent for seamless database access. Resolvers can return Eloquent collections or models, and the schema will automatically serialize them to JSON.
What security measures are included for GraphQL queries?
The library supports query depth limiting and introspection control via middleware. For auth, use Laravel’s middleware (e.g., Sanctum, Passport) on the GraphQL route. Always validate input types to prevent injection.
How do I define custom scalars (e.g., DateTime) in this library?
Extend the `ScalarType` class and register it with the schema. Example: `Schema::addCustomScalar(new DateTimeScalar());`. The library provides hooks for parsing and serializing custom types.
Are there tools for debugging GraphQL queries in development?
Yes, integrate GraphiQL or Apollo Studio for interactive query testing. The library supports introspection by default, enabling tooling like schema validation and documentation generation.
What’s the best way to handle authentication for GraphQL mutations?
Use Laravel’s middleware on the GraphQL route (e.g., `auth:api`). For fine-grained control, attach middleware to specific mutations via resolver metadata or pipeline hooks.
Should I migrate from youshido/graphql to a newer library like graphql-php/graphql-php?
If you need PHP 8.1+/Laravel 9+ support, active maintenance, or modern features (e.g., Federation), consider migrating. The newer library offers better tooling and compatibility but may require schema refactoring.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky