I'm using graphql-yoga and use transformSchema to rename root query for a remote schema.
The query works fine. But for subscription, i got the error : Cannot return null for non-nullable field on subscription_root.table_name
The function to rename is
function renameSchema(remoteExecSchema, prefix) {
return transformSchema(
remoteExecSchema,
[
new RenameTypes((type) => `${prefix}_${type}`),
new RenameRootFields((operation, name) => `${prefix}_${name}`)
]
);
}
I think this is related to https://github.com/apollographql/graphql-tools/issues/997
cc @Maxpain177
@revskill10, Did you find a workaround?
@wawhal Can we figure out if it is an issue with apollo and send a PR to them if that's the case?
I could replicate this. Working on a fix.
Tracked here. Please add a thumbs up so that it gains priority :-)
@Maxpain177 Till now, my strategy is to untrack tables which has duplicated name, then i create a view with different name. That's why i created the related issue here, which allows untracking multiple tables at once.
@0x777 @wawhal Can we close this issue?
Yes. Not related to Hasura.
This issue is closed since it is being tracked at https://github.com/apollographql/graphql-tools/issues/1002.