Comments (7)
@kikoseijo What some of us is aiming for is basically defining our whole query with directives. And when we have more advanced queries, then have a custom scope to handle that.
However this package does not limit us to one approach which I like a lot, so we can easily use a repository pattern or just use the query builder directly.
I got a big system which I have been able to easily translate to graphQL by using scopes and the directives, so I am a big fan of query builder manipulation approach. ( I have only translated the fetching of data, not inserting/updating)
from lighthouse.
Can't you just use the node endpoint and then use the global ID?
from lighthouse.
@olivernybroe if we were using relay yep, that's exactly how we'd do it, but as you can see from the example I also want to be able to find the single user from their email. User is just one example of where we'd want to find a single model by a given field that isn't the id.
Obviously we could just paginate and only take the first item, but that's certainly not ideal!
from lighthouse.
Yep, got it. So should the directive be called find or should it be called first?
from lighthouse.
I think that depends on whether we want to throw an error if the query would return more than one result? To me I feel it would likely be an error if the built query wasn't specific enough to nail just one result?
from lighthouse.
Maybe we should have both? Both of them should be easy to make, and I can see a use case for both of them. So find requires the result to only return 1 row, while first just takes the first result.
from lighthouse.
Hummm,
Im a bit amazed, seems we want to be able to do all with a single schema definition?
Don't know about you, but when you can resolve a query using a repository, a class method, or ... isn't better to have an Eloquent repository and use one of your hand made methods to resolve this queries?
keep it simple and elegant!
Just some thoughts.
🤯
from lighthouse.
Related Issues (20)
- Programmatically defined types cannot be found or overwrited while parsing .graphql file HOT 3
- @guard directive in fields but I always get "Unauthenticated" error. HOT 1
- Multiple queries / mutations in single request stop at first error HOT 3
- I faced issue lighthouse middleware HOT 1
- work with Multiple database connection HOT 1
- NOT_LIKE operator not working HOT 1
- ебаные пидорасы
- Directives for root types HOT 3
- Schema cache leaks memory with Laravel Octane HOT 1
- I have problems with many-to-many connections
- GraphQL integration in Laravel Repository Pattern
- Can not solve multiple file upload
- [FEDERATION] error SATISFIABILITY_ERROR when check the schema HOT 2
- `@in` directive breaks if client sends null HOT 1
- "No query results for model [App\\Models\\Permission]." using @create mutation HOT 4
- When using throttle directive how can the client be informed when they can retry again etc. HOT 3
- `@can` directive improvements HOT 1
- Only allow deletion of related models in nested mutations
- `@can` with `injectArgs: true` doesn't inject args passed as variables HOT 3
- laravel lighthouse graphql getting error Content-Type multipart/form-data HOT 3
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.