GraphQL
laravel-lighthouse serves /graphql from the schema in graphql/schema.graphql, written with
Lighthouse directives such as @paginate, @find, @belongsTo and @count.
The Post and User models are registered with the provider, so their tables and keys come from
the Rust types. Pick an example or write a query; the page sends it with fetch.
laravel-lighthouse
Query
Response
Run a query to see the JSON response.
From the command line:
curl -s /graphql -H 'content-type: application/json' \
-d '{"query": "{ postCount }"}'
Commands
cargo run -- lighthouse:print-schema # the client schema with the generated types cargo run -- lighthouse:validate-schema