Giter Club home page Giter Club logo

Comments (7)

altano avatar altano commented on May 20, 2024

Hey! Does using fragments just need documentation, or is it not working yet and there's work left to be done?

from graphql-hooks.

bmullan91 avatar bmullan91 commented on May 20, 2024

@altano Just docs required - it's just combining template strings, perhaps documenting some best practices.

from graphql-hooks.

altano avatar altano commented on May 20, 2024

If you link me to a code example of any kind I could maybe figure it out and help write a draft of the docs? No rush. Thanks!

from graphql-hooks.

altano avatar altano commented on May 20, 2024

And I certainly hope you don't actually mean it's just template string concatenation of strings like:

const userFragment = graphql`
  name
  profileUrl
`;
const query = graphql`
  query Users {
    edges {
      node {
        ${userFragment}
      }
    }
  }

This might be fine for a REALLY tiny site but it would obviously have all sorts of issues like debuggability. For example, if the query ended up being invalid you'd have no way of knowing where the problematic code actually was. And you'd have to pass all data from the entire response to all components.

But then again if I want more than that, perhaps I should shut up and use something more full featured like Relay?

from graphql-hooks.

matepaiva avatar matepaiva commented on May 20, 2024

Hey, is there any possible timeframe for the fragment documentation? I can't help because I have never used graphql-hooks. Actually I am considering migrating from relay to here, but I don't know if it is a good Idea, mainly because of how relay deals with fragments.

from graphql-hooks.

simoneb avatar simoneb commented on May 20, 2024

When this issue was created, fragments were probably not as common as they are now. I don't think we need docs for that as there is nothing special that this library is going to support fragments, they are simply part of GraphQL and hence available in any implementation. I'm going to close this issue.

from graphql-hooks.

matepaiva avatar matepaiva commented on May 20, 2024

Fair enough :)

from graphql-hooks.

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.