Reputation: 43
{
"error": {
"message": "No directive found for `orderBy`",
"exception": "Nuwave\\Lighthouse\\Exceptions\\DirectiveException",
"file": "C:\\xampp\\htdocs\\dev\\lumen-lighthouse\\vendor\\nuwave\\lighthouse\\src\\Schema\\DirectiveLocator.php",
"line": 175,
"trace": [
{
"file": "C:\\xampp\\htdocs\\dev\\lumen-lighthouse\\vendor\\nuwave\\lighthouse\\src\\Schema\\DirectiveLocator.php",
"line": 142,
"function": "resolve",
"class": "Nuwave\\Lighthouse\\Schema\\DirectiveLocator",
"type": "->"
},
How to get rid of the above error? I am getting no solution.
Call:
query {
orderBooks(orderBy: [{ column: id, order: ASC }]) {
title,
author
}
}
Schema:
type Query {
orderBooks(orderBy: _ @orderBy(columns: ["id", "title"])): [Book!]! @paginate(builder: "App\\GraphQL\\Builders\\BookBuilder@searchBooks")
}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Upvotes: 0
Views: 1405
Reputation: 1638
Enzo missed you were using Lumen, in Lumen service providers are not registered using the config/app.php
file.
In Laravel Lumen you will have to register all the needed Lighthouse service providers manually in bootstrap/app.php
.
This is done here. And these are the possible service providers, add the ones you need.
This is explained in the installation docs, but not in great detail so you might have missed this.
Upvotes: 0
Reputation: 659
Did you added the OrderByServiceProvider to your config/app.php
?
Upvotes: 0