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
1 answer

What is the Lighthouse GraphQL subscriptions Best Practice

I have tried to find best practice for Lighthouse subscription during 2 weeks. But i cant find the best practice until now. This is my shema.graphql type Subscription { rsvHolidaySub(id: ID): Rsv_holiday } type Mutation { updateHoliday(id:…
Jeongkuk Seo
  • 127
  • 2
  • 15
0
votes
1 answer

Laravel + Lighthouse (GraphQL) custom mutation validation

Earlier I used pure graphQL for Laravel and I didn't have a problem with it, because the whole validation could be done in files in ../GraphQL/mutations/. However, I have now started using the lighthouse and many things are done differently. For…
0
votes
0 answers

How can catch validation message?

I have some test for field validation. How I can assert response error message? this is my simple test /** @test */ public function categoryRequiresName() { $response = $this->postGraphQL([ 'query' => ' mutation…
user11286287
0
votes
1 answer

How to create mutation with 3 or more nested relationships?

I am creating an ipotetic CRUD, based on a business that I have studied. The problem is that i try to make a nested mutation as shown in lighthouse docs but with three levels of depth in the relationship as {client has many contacts and contacts has…
eberna
  • 3
  • 1
0
votes
1 answer

How to call an Eloquent dynamic scope (with 1 argument) from a GraphQL schema in a Laravel project?

I have a Laravel project with some models, relationships and dynamic scopes into models to perform some queries along model relationships. I want to query these models using a GraphQL endpoint using the Lighthouse package. Is there any way to call…
jairochapela
  • 38
  • 1
  • 6
0
votes
1 answer

polygon lighthouse graphql type

I am using lighthouse PHP in my laravel 5.7 application. I'm trying to define an geometric field(polygon) in my schema, but it didn't work well. Can anyone help me how to define the polygon field in my graphql schema. schema and query code
Walidovic
  • 21
  • 1
  • 7
0
votes
1 answer

How to add dynamic where clause in laravel using php lighthouse for graphql processing

I have implemented schema for fetching activities from the system and is working perfortly on fetching the whole list. I want to start passing user_id so as to filter based on the user or to filter by top 10 last week activities. My schema is; The…
Dedan Irungu
  • 61
  • 2
  • 6
-1
votes
2 answers

How to change/customize the response format of Lighthouse?

I am using Lighthouse GraphQL with Laravel 9 for my application. Graphql have standard format and each response show under the data and operation name. It does not show proper response (error/success) to handle for front-end application. Because, on…
-1
votes
1 answer

Typed document node with vue3 apollo and complex where

I use this package https://github.com/dotansimha/graphql-typed-document-node and I usually call it like this useQuery(peopleDocument, variables). But laravel lighthouse has a complex where plugin which automatically adds all types for various…
Trekstler
  • 71
  • 9
-1
votes
1 answer

Can i extend object type in graphql lighthouse-php?

I am using lighthouse-php with laravel. I need to use type Employee in multiple queries and in different schemas. In some cases Employee can have extra fields. #employee.graphql type Employee{ id: ID name: String } #company.graphql extend…
Arun
  • 344
  • 2
  • 11
-1
votes
2 answers

How to retrieve a model with a filter on one of it's hasMany relationships?

I'm trying to get a model and also add filter to one of it's hasMany relationships. Let's say I have two models. One of is Location and other one is the LocationAnalytic. Location model hasMany LocationAnalytic class. So when I want to retrieve a…
Can Atuf Kansu
  • 523
  • 2
  • 7
  • 16
-1
votes
1 answer

Laravel lighthouse JSON type

How can I add JSON type to lighthouse? I've seen this package but I don't know how to use it and there's not any documentations available for it: https://github.com/mll-lab/graphql-php-scalars
Alireza A2F
  • 519
  • 4
  • 26
-1
votes
1 answer

Laravel 8 with Lighthouse 5.3.0 : Having issue with pass auth token in headers

I tried to setup successfully graphQL with Laravel 8 using Lighthouse 5.3.0 I am having issue when I pass auth token in header with graphiQL Here is my query schema type Query { user(id: ID! @eq): User @guard(with: ["api"]) @find …
-1
votes
1 answer

Can i use package method in graphql scheme?

Using this package - https://github.com/rtconner/laravel-likeable im trying to set number of likes to the comment type. Can u plese tell me, its real to use this method inside scheme without custom query? screenshot type Comment { id: ID! …
-1
votes
3 answers

GraphQL define implicitly what a user can do

I'm using Laravel Lighthouse. Following situation: I have users, and those users should be allowed to access different datasets and run different mutations. My solution: The users are assigned roles, and those roles define what datasets the user can…
Lutan
  • 43
  • 4
1 2 3
18
19