Giter VIP home page Giter VIP logo

Comments (7)

olivernybroe avatar olivernybroe commented on July 19, 2024 2

@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.

olivernybroe avatar olivernybroe commented on July 19, 2024

Can't you just use the node endpoint and then use the global ID?

from lighthouse.

hailwood avatar hailwood commented on July 19, 2024

@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.

olivernybroe avatar olivernybroe commented on July 19, 2024

Yep, got it. So should the directive be called find or should it be called first?

from lighthouse.

hailwood avatar hailwood commented on July 19, 2024

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.

olivernybroe avatar olivernybroe commented on July 19, 2024

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.

kikoseijo avatar kikoseijo commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.