Comments (7)
Those are great suggestions and I agree the documentation should be improved. PR's are surely welcome. Thanks for the issue.
from apollo-elements.
Thank you very much, this looks super good now!
from apollo-elements.
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.
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.
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.
I'm still don't unterstand that part:
<connected-child id="child-component"
.client="${this.client}"
.query="${childQuery}"
>`
from apollo-elements.
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)
- @apollo-elements/create does not install dependency HOT 3
- Default App of @apollo-elements/create does not run out-of-the-box. HOT 1
- [Security] Workflow pull-request.yml is using vulnerable action paambaati/codeclimate-action HOT 1
- [idea]: Update strategies for <apollo-mutation>
- Unable to get `apollo-query` to retrieve data HOT 4
- Apollo Elements Bug HOT 5
- Apollo Elements Bug - Cannot lazily initialize query controllers HOT 13
- Error on npm init @apollo-elements HOT 2
- [bug] Include @apollo-elements/rollup-plugin-graphql package HOT 2
- [bug] esbuild `startService` error when running build HOT 1
- Apollo Elements Query Controller should have arguments as callbacks to be able react to host variable changes HOT 1
- [bug] data is missing in changedProperties Map in updated hook in ApolloQuery component HOT 1
- Not able to configure Apollo Elements HOT 2
- Playground is very confusing. HOT 1
- loading property doesn't change with autosubscribe and no explicit notifyOnNetworkStatusChange: true HOT 3
- @defer support HOT 9
- Safari notice about `static` HOT 5
- TS apps are unable to instantiate `ApolloController`s outside of class definition or to specify dynamic `ApolloClient` instance HOT 5
- Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>' HOT 3
- Incompatible with `nodenext` HOT 1
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 apollo-elements.