Code Monkey home page Code Monkey logo

Comments (7)

bennypowers avatar bennypowers commented on May 13, 2024 1

Those are great suggestions and I agree the documentation should be improved. PR's are surely welcome. Thanks for the issue.

from apollo-elements.

TimPietrusky avatar TimPietrusky commented on May 13, 2024 1

Thank you very much, this looks super good now!

from apollo-elements.

TimPietrusky avatar TimPietrusky commented on May 13, 2024

I just found https://apolloelements.dev/lit-apollo/#/classes/ApolloQuery, which is super helpful and should be added to the README of lit-apollo too.

from apollo-elements.

kevinsimper avatar kevinsimper commented on May 13, 2024

That there is no link to ./cache & ./link is just making this super confusing, I normally go to Webcomponents for a simpler approach and this made me more confused and the demo is super complex as well 😅

from apollo-elements.

bennypowers avatar bennypowers commented on May 13, 2024

Thanks @kevinsimper for the notes. Not to kick the can but in our case, the majority of the DX complexity comes from apollo. Luckily for us, apollo-client 2.6.0 just landed which hopefully will provide some niceties for developers that want to bundle it. God-willing, I'll soon have some time to review the README and improve it.

from apollo-elements.

teamgroove avatar teamgroove commented on May 13, 2024

I'm still don't unterstand that part:
<connected-child id="child-component"
.client="${this.client}"
.query="${childQuery}"
>`

from apollo-elements.

bennypowers avatar bennypowers commented on May 13, 2024

@teamgroove

In that example, we are binding the ApolloClient instance down to the child component.

If in the first place, we assign the client to window.__APOLLO_CLIENT__, then it will not be necessary to explicitly bind it, which Is what I prefer.

The point of showing an example of explicitly binding is for someone who, for whatever reason, doesn't want to assign it to a global variable.

☝️ all that, it seems, should be added to the docs.

As for the query, just like we can bind a GraphQL query document in a class field, or in the constructor, you can also set it as a property on a component instance. This might be useful if you have a variety of queries which all share a common response schema, and you want to write a common display component for them:

html`
  <response-element .query="${catsQuery}"></response-element>
  <response-element .query="${dogsQuery}"></response-element>
  <response-element .query="${ayeayesQuery}"></response-element>
`

This, too, should be made explicit in docs.

I really appreciate your coming here to give your feedback. I'll reopen this issue until those points are resolved.

from apollo-elements.

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.