77
88from model_enums .sectors import SectorEnums , ZoneEnums
99from model_enums .groups import GroupEnums
10+ from model_enums .organiztions import OrganizationsEnum
1011
1112from schemas .user import *
1213
1314from schemas .sectors import Sectors
1415from schemas .groups import Groups
16+ from schemas .organizations import Organizations
1517
1618
1719from resolvers .sectors import (
2628 resolve_get_group_by_sector
2729)
2830
31+ from resolvers .organizations import (
32+ resolve_get_org_by_id ,
33+ resolve_get_org_by_org ,
34+ resolve_get_orgs_by_group
35+ )
36+
2937
3038class Query (graphene .ObjectType ):
3139 """The central gathering point for all of the GraphQL queries."""
@@ -54,7 +62,7 @@ class Query(graphene.ObjectType):
5462 )
5563 get_group_by_id = graphene .List (
5664 of_type = Groups ,
57- id = graphene .Argument (graphene .Int , required = False ),
65+ id = graphene .Argument (graphene .Int , required = True ),
5866 resolver = resolve_get_group_by_id ,
5967 description = "Allows selection of a group from a given group ID"
6068 )
@@ -70,6 +78,24 @@ class Query(graphene.ObjectType):
7078 resolver = resolve_get_group_by_sector ,
7179 description = "Allows selection of groups from a given sector enum"
7280 )
81+ get_org_by_id = graphene .List (
82+ of_type = Organizations ,
83+ id = graphene .Argument (graphene .Int , required = True ),
84+ resolver = resolve_get_org_by_id ,
85+ description = "Allows the selection of an organization from a given ID"
86+ )
87+ get_org_by_org = graphene .List (
88+ of_type = Organizations ,
89+ org = graphene .Argument (OrganizationsEnum , required = True ),
90+ resolver = resolve_get_org_by_org ,
91+ description = "Allows the selection of an organization from its given organization code"
92+ )
93+ get_org_by_group = graphene .List (
94+ of_type = Organizations ,
95+ group = graphene .Argument (GroupEnums , required = True ),
96+ resolver = resolve_get_orgs_by_group ,
97+ description = "Allows the selection of organizations from a given group"
98+ )
7399
74100 generate_otp_url = String (email = String (required = True ))
75101
0 commit comments