-
Notifications
You must be signed in to change notification settings - Fork 152
Support for graphql as an element #129
Comments
wow that's a neat idea! |
I'm glad your interested. I can put some work into it if you want a PR, but obviously this is your project; so you understand it best. Would you like me to try it. |
I currently don't have time to look into this, but it would be interesting to think through the design details first - e.g.
|
I'll throw together an ideal usage example when I get the chance, probably this weekend. I think raw graphql-js would be the best way to go about this. A good starting point would be to simply let the user fetch data only (no mutations, queries only). We can always expand on it later on. Start simple, and see if people actually find this useful and want to use it. In terms of whether its worth it, i think it will be, even just for the initial fetching of data; if we can simplify that process, then thats a good start. |
I'm having trouble setting this up for testing it locally. Is the best way to do it to go TDD on it, and create some test files in the test folder and try to get the code to pass, or is there a better way? Perhaps a contribution.md file to explain the best way to contribute would be good :) |
Which branch are you working on? Make sure to work on top of |
Ah. I was working on master. Okay, i'll switch my base :) |
I'm trying to run the tests from the
is there anything i'm doing wrong? |
that was a peer dep of |
Should it be saved into the package.json file or is it supposed to not be installed automatically? E: tests pass when I install it. |
It should, it's just not updated yet. |
What do you think of this as something to aim for? <template>
<div>
Starwars Film: {{ film.title }}
Directed by: {{ film.director }}
</div>
</template>
<graphql>
{
film(filmID: 1) {
title
director
}
}
</graphql>
<script>
export default {
props: ['film'],
data(graphql) {
return graphql
.success(function(data) {
return {
film: data.film
}
})
.error(function(errors) {
// Handle errors here
})
}
}
</script> Example Used: |
Support for GraphQL would be pretty neat, to populate the object on load.
Something like this:
Which would then be able to fill the data object and redraw the view.
This would only be used for an on-load fetch
The text was updated successfully, but these errors were encountered: