Questions tagged [laravel-lighthouse]

Lighthouse is a PHP package that allows you to serve a GraphQL endpoint from your Laravel application.

Lighthouse is a PHP package that allows you to serve a GraphQL endpoint from your Laravel application. It greatly reduces the boilerplate required to create a schema, it integrates well with any Laravel project, and it's highly customizable giving you full control over your data.

276 questions
0
votes
0 answers

Cannot use "connect" in pivot attribute, "Array to string conversion" occurs

I have two tables Element and Measurement with a many-to-many relationship, and an ElementMeasurement pivot table that contains an optional attribute template_id, which is a foreign key to another Element entry. I have my Models defined as…
Wolfeur
  • 142
  • 1
  • 8
0
votes
1 answer

How can I disable GraphQL Api doc in nuwave lighthouse when I release the server

I'd like to disable the GraphQL API doc query entry(which lists the document of all my GraphQL Apis) in lighthouse, but I'v not yet found any configuration for that. How can? Thanks.
0
votes
1 answer

Need Array Format in result object using graphql

How can I change the format in Grapql Type My Queries Look like below type GetAllProducts{ id: ID! title: String description: String userId: Int featured: Int isFree: Boolean isBlocked: Boolean instantBuy: Boolean groupsId: String } My Expected…
Manimaran
  • 405
  • 2
  • 8
  • 20
0
votes
1 answer

Error when attempting to combine limit with paginate

When performing the GraphQL query below, lighthouse throws the following error: Nuwave\Lighthouse\Pagination\PaginatorField::dataResolver(): Argument #1 ($root) must be of type Illuminate\Contracts\Pagination\LengthAwarePaginator, array…
xorinzor
  • 6,140
  • 10
  • 40
  • 70
0
votes
1 answer

Laravel Federation

I have a problem with GraphQL and I want to create a federation with Laravel 9. I use: https://lighthouse-php.com/5/federation/getting-started.html to create monolog GraphQL and created 2 Laravel projects named "a" and "b". they work separately…
user2889491
  • 3
  • 1
  • 1
  • 3
0
votes
1 answer

How can I access parent scope in laravel lighthouse relationship?

Laravel lighthouse doesn't access relationship scope like eloquent. class Tenant extends Model { public function products(): HasMany { return $this->hasMany(Product::class); } …
grimdbx
  • 175
  • 2
  • 12
0
votes
1 answer

GraphQL Schema not Loaded on Heroku

Has anyone used this GraphQL Laravel Library before? I managed to get it working on my local machine. But when I deploy it to Heroku, I keep getting an error that my schema is not loaded. How do I resolve this? Here's a screenshot of my local…
Davina Leong
  • 737
  • 2
  • 11
  • 28
0
votes
1 answer

set guard subscriptions auth

Laravel6 lighthouse-php5 I'm using lighthouse-php for GraphQL Subscription and pusher. lighthouse-php5 gives graphql/subscriptions/auth. But I can't find how to set guard this api. My app has multiple authentications(user and admin), so I want to…
Hitomi
  • 3
  • 2
0
votes
1 answer

remove unsubscribed subscriptions

Laravel6 lighthouse-php5 I'm using lighthouse-php for GraphQL Subscription and I receive the message from pusher. So I have the question of Subscription unsubscribe. server side => pusher => front side Documantation this part means just stop…
Hitomi
  • 3
  • 2
0
votes
1 answer

Laravel Lighthouse sending OPTIONS request with every mutation, how to stop it?

I'm using Laravel with Lighthouse-PHP graphql, everything working fine, but the graph sends cors OPTIONS request every time I send mutations. Here's the mutation request: I configured config/cors.php as following, but still the same: 'paths'…
0
votes
1 answer

Laravel Lighthouse-PHP GraphQL (Server cannot be reached)

I'm using Laravel - Lighthouse-PHP GraphQL server, and when I deploy it to production, I have to write public in the URL in order to work: https://example.com/graphql (Server cannot be reached) ✗ https://example.com/public/graphql (Server…
0
votes
2 answers

Lighthouse GraphQL Sorting on relation

I'm having issues on another relation. I want the ability to sort on the column title that is in the relation on the front end. Here's my setup: extend type Query { entries(first: Int!, page: Int, type: String @eq, site_id: ID @eq, …
cbloss793
  • 1,555
  • 4
  • 19
  • 30
0
votes
1 answer

GraphQL query param on sub query

I'm using Lighthouse with GraphQL and trying to figure out how to pass in a param into a relationship (I have a feeling I'm not using the right terms). Here's what I got: type Entry { id: ID! site_id: ID slug: String! admin_note: String …
cbloss793
  • 1,555
  • 4
  • 19
  • 30
0
votes
1 answer

Pass logged user argument to @scope directive

I need to fetch a type (to get the logged user's orders) by giving the current User to the scopeAvailableForUser. So I did the following extend type Query { wallet( user: User = me @scope(name: "availableToUser") ): [DigitalProduct!]…
gizon_dev
  • 36
  • 1
  • 5
0
votes
1 answer

How to Query Multiple Pivot Relationship in Laravel Lighthouse

Hi, there I'm fairly new to laravel-lighthouse. I've read the documentation but unfortunately, there is no detail about this issue. My question is How can I query more than one pivot table. I have an Item table that belongs to many other…
Waheed Sindhani
  • 91
  • 1
  • 13