Added children to resource interface

graph-rework
noah metz 2023-06-21 11:50:57 -06:00
parent 9103b01990
commit 3405521e9f
1 changed files with 14 additions and 0 deletions

@ -491,6 +491,10 @@ func GQLInterfaceResource() * graphql.Interface {
Type: GQLListResource(), Type: GQLListResource(),
}) })
gql_interface_resource.AddFieldConfig("Children", &graphql.Field{
Type: GQLListResource(),
})
gql_interface_resource.AddFieldConfig("Owner", &graphql.Field{ gql_interface_resource.AddFieldConfig("Owner", &graphql.Field{
Type: GQLInterfaceNode(), Type: GQLInterfaceNode(),
}) })
@ -573,6 +577,11 @@ func GQLTypeGQLServer() * graphql.Object {
Resolve: GQLResourceParents, Resolve: GQLResourceParents,
}) })
gql_type_gql_server.AddFieldConfig("Children", &graphql.Field{
Type: GQLListResource(),
Resolve: GQLResourceParents,
})
gql_type_gql_server.AddFieldConfig("Owner", &graphql.Field{ gql_type_gql_server.AddFieldConfig("Owner", &graphql.Field{
Type: GQLInterfaceNode(), Type: GQLInterfaceNode(),
Resolve: GQLResourceOwner, Resolve: GQLResourceOwner,
@ -617,6 +626,11 @@ func GQLTypeBaseResource() * graphql.Object {
Resolve: GQLResourceParents, Resolve: GQLResourceParents,
}) })
gql_type_gql_server.AddFieldConfig("Children", &graphql.Field{
Type: GQLListResource(),
Resolve: GQLResourceParents,
})
gql_type_base_resource.AddFieldConfig("Owner", &graphql.Field{ gql_type_base_resource.AddFieldConfig("Owner", &graphql.Field{
Type: GQLInterfaceNode(), Type: GQLInterfaceNode(),
Resolve: GQLResourceOwner, Resolve: GQLResourceOwner,