-
Notifications
You must be signed in to change notification settings - Fork 48
GraphQL helpers #19
Comments
@abdonrd you can use apollo-client from web components and with lit-element. Create an apollo client
Import it where you need it and do query
|
There's this also: https://github.com/bennypowers/lit-apollo |
@eskan your example doesn't work because ES Modules.
Another reference: apollographql/apollo-client#3571 |
@abdonrd this sample is a bit outdated with latest Apollo-client but it works like a charm. The error you've mentioned seems not related to apollo ? |
@eskan That error occurs just with: import ApolloClient from 'apollo-boost';
const client = new ApolloClient(); |
it should be related to the way you serve/package your application. |
With |
Error reproduction: https://jsfiddle.net/va2uxesr/ You can see in the console:
|
Here i write a sample that can help you : https://stackblitz.com/edit/lit-demo-base-ts-graphql
a simple webpack.config.js
and change the import in your index.html to
|
@abdonrd Did you manage to resolve the issue? |
@hashamhabib not in a easy way for the PWA Starter Kit with ES Modules. 😕 |
@hashamhabib is not really an issue related to pwa-helpers or lit-element. You're able to use many other libraries to handle data : locally/remotely
IMHO Apollo-client doesn't need helpers. Uses of Vanilla client is a perfect way to deal with apollo. |
The same as with Redux, do you have any workaround about Web Components + GraphQL?
Maybe with something like apollo-client.
Thanks in advance!
The text was updated successfully, but these errors were encountered: