Skip to content
New issue

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

Subscriptions nested fields/operations #87

Open
tsukeero opened this issue Oct 10, 2023 · 0 comments
Open

Subscriptions nested fields/operations #87

tsukeero opened this issue Oct 10, 2023 · 0 comments

Comments

@tsukeero
Copy link

Using the same query with nested operation on subscription throws an error (works with normal query):

fields: [
                "id",
                {
                    operation: "some_aggregate",
                    fields: [{aggregate: ["count"]}],
                    variables: {
                      varname: {
                        name:"where",
                        type:'some_aggregate_bool_exp!',
                        value: {
                            visible: { _eq: true },
                        }
                      },
                    },
                },
            ],

Uppon quick look at the source it looks they use a different implementation of queryFieldsMap.

The DefaultQueryAdapter.ts is using Utils.queryFieldsMap(this.fields)
While the DefaultSubscriptionAdapter is using this.queryFieldsMap(this.fields)](https://github.com/atulmy/gql-query-builder/blob/master/src/adapters/DefaultSubscriptionAdapter.ts#L94C6-L94C40) (which is different and doesn't seem to have nested fields handled correct).

Would the fix be a simple replacement to call the one from utils or is something else I am missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant