-
Hello, This is the default endpoint: This is secret endpoint; Maybe some other endpoint whether or not secret; Apollo Http Link has context feature so I can also change the endpoint on the go; new Vue({
apollo: {
serverData: {
query: gql`query getCountries($status:String!) {
countries (status: $status) {
id,
name
}
}`,
variables: {
status: 'active'
},
context: {
uri: 'http://127.0.0.1:8000/graphql/countries'
}
}
},
}) What I understand from the Multiple Clients, I can also use this setup; const apolloProvider = new VueApollo({
clients: {
default: apolloClient,
secret: secretApolloClient,
countries: countriesApolloClient
},
defaultClient: apolloClient,
})
new Vue({
apollo: {
serverData: {
query: gql`query getCountries($status:String!) {
countries (status: $status) {
id,
name
}
}`,
variables: {
status: 'active'
},
$client: 'countries'
}
},
}) So what's the true approach here? Am I mixing apples and pears? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I would say both are valid, so use what suits you best. |
Beta Was this translation helpful? Give feedback.
-
@Akryum Thank you for prompt enlightenment! |
Beta Was this translation helpful? Give feedback.
I would say both are valid, so use what suits you best.