作者: | 来源:互联网 | 2023-09-18 16:48
Hi
I have just implemented Apollo Client 2.0 with VueApollo. I'm having some problems though, and I was hoping you might have some insights or pointers where to look.
A simple apollo: query
1 2 3 4 5 6 7
| rows: gql`query {
iwRegions {
id
country_id
name
}
} |
is sending an auto-injected '__typename' column request through to my SQL backend server, which naturally has no idea what to do with it.
I tried implementing a suggestion to filter out the _typename as follows, but it has no effect on the problem:
1 2 3 4 5 6 7 8 9 10
| graphQLServer.use('/graphql', graphqlExpress({
schema: graphQlSchema,
formatParams: (params) => {
const { variables, ...rest } = params;
return {
variables: omitDeep(variables, '__typename'),
...rest
}
}
})); |
Can you offer any ideas on this?
TIA
Adrian
该提问来源于开源项目:vuejs/vue-apollo
The problem was in my objection-graphql middleware, it just needed to filter out the __typename 'column'. Solved!