Constant telescope::api::rcos::users::developers_page::all_developers::__QUERY_WORKAROUND[][src]

const __QUERY_WORKAROUND: &str = "# Fragment used by the two variants of the Developers query to get user info.\nfragment UserInfo on users {\n    id\n    first_name\n    last_name\n\n    # Role is removed for now since we don\'t use it anywhere\n    #role\n\n    # RCS ID if available\n    rcs_id: user_accounts(where: {type: {_eq: \"rpi\"}}) {\n        account_id\n    }\n\n    # Semesters coordinating\n    coordinating: enrollments(\n        where: {\n            is_coordinator: {_eq: true}\n        },\n        order_by: [\n            {semester: {start_date: desc}}\n        ]\n    ) {\n        semester {\n            title\n        }\n    }\n\n    # Semesters mentoring\n    mentoring: small_group_mentors(order_by: [\n        {small_group: {semester: {start_date: desc}}}\n    ]) {\n        small_group {\n            title\n            semester {\n                title\n            }\n        }\n    }\n}\n\n# Developers Page Query (including older developers)\nquery AllDevelopers(\n    $limit: Int!,\n    $offset: Int!,\n    $search: String!,\n) {\n    # Count of users to determine the number of pages\n    user_count: users_aggregate(where: {\n        _or: [\n            {first_name: {_ilike: $search}},\n            {last_name: {_ilike: $search}},\n            {user_accounts: {account_id: {_ilike: $search}, type: {_eq: \"rpi\"}}},\n        ]\n    }) {\n        aggregate {\n            count\n        }\n    }\n\n    users(\n        limit: $limit,\n        offset: $offset,\n        where: {_or: [\n            {first_name: {_ilike: $search}},\n            {last_name: {_ilike: $search}},\n            {user_accounts: {account_id: {_ilike: $search}, type: {_eq: \"rpi\"}}},\n        ]},\n        order_by: [{first_name: asc}, {last_name: asc}]\n    ) {...UserInfo}\n}\n\n# Separate query to get list of (current) developers for the developers page.\nquery CurrentDevelopers(\n    $limit: Int!,\n    $offset: Int!,\n    $search: String!,\n    $now: date!,\n) {\n    # Current user count -- used to determine the number of pages.\n    user_count: users_aggregate(where: {\n        enrollments: {semester: {\n            start_date: {_lte: $now}\n            end_date: {_gte: $now}\n        }},\n        _or: [\n            {first_name: {_ilike: $search}},\n            {last_name: {_ilike: $search}},\n            {user_accounts: {account_id: {_ilike: $search}, type: {_eq: \"rpi\"}}},\n        ]\n    }) { aggregate { count } }\n\n    users(\n        limit: $limit,\n        offset: $offset,\n        where: {\n            enrollments: {semester: {\n                start_date: {_lte: $now}\n                end_date: {_gte: $now}\n            }},\n            _or: [\n                {first_name: {_ilike: $search}},\n                {last_name: {_ilike: $search}},\n                {user_accounts: {account_id: {_ilike: $search}, type: {_eq: \"rpi\"}}},\n            ]\n        }\n        order_by: [{first_name: asc}, {last_name: asc}]\n    ) {... UserInfo}\n}\n";