Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove configuration settings from the compiled JS to be more polymer-esque. #2

Open
paales opened this issue Apr 24, 2017 · 1 comment

Comments

@paales
Copy link

paales commented Apr 24, 2017

Hi there!

Thanks for the work on the polymer module! Trying out your module at the moment :)

The idea with Polymer is that you can import an element and use that without any knowledge about the internals.

I think the API should be something like this:

<apollo-client name="clientname" config='{ "uri": "https://myendpoint" "connectToDevTools": true }'></apollo-client>

Then in your element do something like:

behaviors: [
    Apollo.behavior('graphcms')(...query)
]

This currently causes an issue with the lifecycle. Because the element apollo-client is intialized later dan the behaviors are parsed..

Maybe there should be an element that allows you to create a query like so:

<apollo-query query="bla" params="{bla}" result="[[queryResultData]]"></apollo-query>
@eskan
Copy link

eskan commented Apr 24, 2017

hi paales,
Is it useful to declare a global singleton as an element ? but i agree that created a behavior at compile time is a bit tricky.
Once that done, using apollo client with kapton is very easy and readable, especially with mutation (.. and promise).
When i've started using Kapton i thought about but i don't need it finally. Most of the time an element use one query which is bind to "data". I like that ui is in template and data/logical are in behavior/js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants