Odd issue with GraphQL

Hey Monday community,

I would like some feedback on this gql query

import { gql } from 'graphql-request';

export const GET_VOLUNTEERS_GROUPED_BY_LANGUAGE = gql`
    query GetVolunteersGroupedByCanSpeakLanguage(
        $boardId: ID!
        $groupId: String!
        $langColId: ID!
        $capacityColId1: String!
        $capacityColId2: ID!
        $limit: Int
    ) {
        boards(ids: [$boardId]) {
            groups(ids: [$groupId]) {
                items_page(
                    limit: $limit
                    query_params: {
                        rules: [
                            { column_id: $langColId, compare_value: [null], operator: is_not_empty }
                            { column_id: $capacityColId2, compare_value: [8], operator: lower_than }
                        ]
                        order_by: [{ column_id: $capacityColId1, direction: asc }]
                    }
                ) {
                    items {
                        id
                        name
                    }
                }
            }
        }
    }
`;

note the type for the same capacityColId is diffrent in the two places.
for some reason using String! or ID! alone and passing the same var to both places threw me type mismatch errors.

Hello there @darkmift,

Would you be able to please send this over to appsupport@monday.com with the actual values of the variables and the exact errors you are getting?

Looking forward to hearing from you via email!

Cheers,
Matias

Hey @Matias.Monday

In the code snippet I sent I changed to use [capacityColId2,capacityColId1] instead of capacityColId where it would fail either as ID! or String! it was taking in a string.

Using said snippet changes should allow reproduction
Here’s the full repo in hopes this may help out.

1 Like