Comments (4)
Workaround:
I did bypass this by modifying lighthouse-graphql-passport.php
config:
'schema' => config('lighthouse.schema.register'),
This will then use the lighthouse default schema.
There was one issue though. If the default schema in lighthouse.php
is auth.graphql
I get the following error
GraphQL\Error\InvariantViolation : The root Query type must be present in the schema.
at /mnt/data/DATA/Community/Community-Server/vendor/nuwave/lighthouse/src/Schema/SchemaBuilder.php:82
78| }
79| }
80|
81| if (empty($queryType)) {
> 82| throw new InvariantViolation(
83| 'The root Query type must be present in the schema.'
84| );
85| }
86|
Exception trace:
1 Nuwave\Lighthouse\Schema\SchemaBuilder::build(Object(Nuwave\Lighthouse\Schema\AST\DocumentAST))
/mnt/data/DATA/Community/Community-Server/vendor/nuwave/lighthouse/src/GraphQL.php:242
The workaround to that was to use my normal schema.graphql
and import auth.graphql
to it.
from lighthouse-graphql-passport-auth.
Hello the and thanks for the question.
So you can define your own schema by setting the file path in your config, when you publish the package config also the default schema is published so you can set the type to what ever you need. This is demonstrated in this article
https://ditecnologia.com/2019/06/24/graphql-auth-with-passport-and-lighthouse-php/
The reason for the schema to be registered and use all those defaults is for convenience, but it is also fully customizable as you can see in the article.
Let me know if that answer your question to close this issue or if you need more guidance in your specific use case.
Thanks!
from lighthouse-graphql-passport-auth.
Yes it is ok to close. The issue I was facing is that I went ahead and created my own schema, but failed to update the config.
My assumption was that if i published the schema and config, the config should automatically use my schema. I see now after re reading the readme it does say the config should be updated. good to close
from lighthouse-graphql-passport-auth.
If you don't have Mutation type at your master schema file... you can NOT extend your schema with Auth schema cuz it has extend type Mutation type which there is nothing to extend...
from lighthouse-graphql-passport-auth.
Related Issues (20)
- Latest version 6.0 migration error HOT 2
- Unable to find byLoggedInUser method on user model.
- Migration failure on fresh install laravel 8 HOT 3
- Support for Eloquent relationships in Register resolver? HOT 1
- Guard issue in production only HOT 2
- Lumen support HOT 1
- Schema documentation missing UpdatePassword argument "old_password" HOT 2
- OAuth Public key is not readable from .env file HOT 5
- Permissions social login HOT 1
- Package Looking for a new home
- Invalid client after php artisan migrate:fresh HOT 2
- How to do CSRF Token Validation? HOT 1
- Default SocialLoginInput overrides custom SocialLoginInput HOT 2
- Change DB connection for tenant HOT 2
- Laravel Passport Version 11 HOT 2
- Support Lighthouse 6.0 HOT 2
- Laravel 10 and PHP Lighthouse 6 support HOT 3
- refreshToken has stopped working due to changes in JWT HOT 2
- How to actually use with Socialite HOT 2
- Call to undefined method App\\Models\\User::token() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lighthouse-graphql-passport-auth.