We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I have an error in my client:
Exception in template helper: TypeError: Template.instance(...).gqlQuery is not a function
Below my code:
import './directors.html'; import gql from 'graphql-tag'; const MY_QUERY = gql`{ getDirectors { label hostname ip } }` Template.directors.helpers({ directors() { return Template.instance() .gqlQuery({ query: MY_QUERY }) .get(); } });
The text was updated successfully, but these errors were encountered:
@ricaragao Try it like this
import gql from 'graphql-tag'; import ApolloClient from 'apollo-client'; import { ApolloLink } from 'apollo-link' import { InMemoryCache } from 'apollo-cache-inmemory'; import { HttpLink } from 'apollo-link-http'; import { MeteorAccountsLink } from 'meteor/apollo' import { setup } from 'meteor/swydo:blaze-apollo'; const client = new ApolloClient({ link: ApolloLink.from([ new MeteorAccountsLink(), new HttpLink({ uri: '/graphql' }) ]), cache: new InMemoryCache() }); setup({ client }); Template.directors.helpers({ directors() { const MY_QUERY = gql` { getDirectors { label hostname ip } }` return Template.instance().gqlQuery({ query: MY_QUERY }).get().getDirectors; } });
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
I have an error in my client:
Exception in template helper: TypeError: Template.instance(...).gqlQuery is not a function
Below my code:
The text was updated successfully, but these errors were encountered: