Giter VIP home page Giter VIP logo

Comments (4)

mfn avatar mfn commented on August 17, 2024 1

If it fits for graphql-laravel, I definitely welcome more docs. The updates on the readme are… not so many.

I'm still not sure what the actual issue is you are having, but maybe you should propose a PR for the docs (aka: readme.md) and we take it from there?

from graphql-laravel.

mfn avatar mfn commented on August 17, 2024

graphql-laravel is a wrapper over https://github.com/webonyx/graphql-php/ and therefore knowledge how this library works and handles those things is necessary to answer this.

Your question is not very specific, but in general there's the concept of a "default field resolver" which uses specific algorithm to "traverse" GraphQL request paths of fields into the returned payload (be it array, objects with getters or attributes etc.)

Specifically, I'm talking about the default implementation from http://webonyx.github.io/graphql-php/data-fetching/#default-field-resolver

This library uses the same (but it can be overriden via config defaultFieldResolver).

From there, we now can learn how the returned data facts are by default handled and so we know what we need to do with relations.

We either can use the SelectFields approach, which handles basic and some advanced cases well but has limitations in other places and therefore I would not recommend it.

Or, for relations, you implement your own resolve and use a dataloader like https://webonyx.github.io/graphql-php/data-fetching/#solving-n1-problem explains, to "lazy eager load" the relational data. But it's definitely more setup work than SelectFields but is indefinitely flexible.

So, not sure that covers your question though? πŸ€”

from graphql-laravel.

drewgallagher avatar drewgallagher commented on August 17, 2024

from graphql-laravel.

mfn avatar mfn commented on August 17, 2024

I'm closing this issue because there's no hard actionable here.

Bugfixes or doc upgrades are of course always welcome.

from graphql-laravel.

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.