Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodlenet
nodejs-services
Commits
278efb54
Commit
278efb54
authored
Oct 15, 2020
by
aleclofabbro
Browse files
removed filters
parent
e1718f36
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
graphql/schema.graphql
View file @
278efb54
interface
Glyph
{
_id
:
ID
!
}
input
StringMatchInput
{
_eq
:
String
_gt
:
String
_lt
:
String
}
input
PageInput
{
limit
:
Int
after
:
ID
}
# Knows
union
KnowsSubject
=
User
union
KnowsObject
=
User
input
KnowsSubjectQueryInput
{
User
:
UserQueryInput
}
input
KnowsObjectQueryInput
{
User
:
UserQueryInput
}
input
KnowsQueryInput
{
_and
:
[
KnowsQueryInput
!]
_or
:
[
KnowsQueryInput
!]
_id
:
[
ID
!]
}
type
Knows
implements
Glyph
{
_id
:
ID
!
_subj
(
query
:
KnowsSubjectQueryInput
,
page
:
PageInput
)
:
[
KnowsSubject
!]!
_obj
(
query
:
KnowsObjectQueryInput
,
page
:
PageInput
)
:
[
KnowsObject
!]!
_subj
:
[
KnowsSubject
!]!
_obj
:
[
KnowsObject
!]!
}
# Follows
union
FollowsSubject
=
User
union
FollowsObject
=
User
input
FollowObjectQueryInput
{
User
:
UserQueryInput
}
input
FollowSubjectQueryInput
{
User
:
UserQueryInput
}
input
FollowsQueryInput
{
_and
:
[
FollowsQueryInput
!]
_or
:
[
FollowsQueryInput
!]
_id
:
[
ID
!]
}
type
Follows
implements
Glyph
{
_id
:
ID
!
_subj
(
query
:
FollowSubjectQueryInput
,
page
:
PageInput
)
:
[
FollowsSubject
!]!
_obj
(
query
:
FollowObjectQueryInput
,
page
:
PageInput
)
:
[
FollowsObject
!]!
_subj
:
[
FollowsSubject
!]!
_obj
:
[
FollowsObject
!]!
}
# User
input
UserQueryInput
{
_and
:
[
UserQueryInput
!]
_or
:
[
UserQueryInput
!]
_id
:
[
ID
!]
username
:
StringMatchInput
}
input
UserRelationQueryInput
{
Follows
:
FollowsQueryInput
Knows
:
KnowsQueryInput
}
union
UserRelation
=
Knows
|
Follows
type
User
implements
Glyph
{
_id
:
ID
!
_rel
(
query
:
UserRelationQueryInput
,
page
:
PageInput
)
:
[
UserRelation
!]!
_rel
:
[
UserRelation
!]!
username
:
String
!
}
# Main
input
GraphQueryInput
{
Knows
:
KnowsQueryInput
Follows
:
FollowsQueryInput
User
:
UserQueryInput
}
type
Query
{
graph
(
query
:
GraphQueryInput
,
page
:
PageInput
)
:
[
Glyph
!]!
graph
:
[
Glyph
!]!
}
input
CreateUserInput
{
...
...
src/gql/graphql.schema.json
View file @
278efb54
This diff is collapsed.
Click to expand it.
src/gql/types.ts
View file @
278efb54
...
...
@@ -17,35 +17,10 @@ export type Glyph = {
_id
:
Scalars
[
'
ID
'
];
};
export
type
StringMatchInput
=
{
_eq
:
Maybe
<
Scalars
[
'
String
'
]
>
;
_gt
:
Maybe
<
Scalars
[
'
String
'
]
>
;
_lt
:
Maybe
<
Scalars
[
'
String
'
]
>
;
};
export
type
PageInput
=
{
limit
:
Maybe
<
Scalars
[
'
Int
'
]
>
;
after
:
Maybe
<
Scalars
[
'
ID
'
]
>
;
};
export
type
KnowsSubject
=
User
;
export
type
KnowsObject
=
User
;
export
type
KnowsSubjectQueryInput
=
{
User
:
Maybe
<
UserQueryInput
>
;
};
export
type
KnowsObjectQueryInput
=
{
User
:
Maybe
<
UserQueryInput
>
;
};
export
type
KnowsQueryInput
=
{
_and
:
Maybe
<
Array
<
KnowsQueryInput
>>
;
_or
:
Maybe
<
Array
<
KnowsQueryInput
>>
;
_id
:
Maybe
<
Array
<
Scalars
[
'
ID
'
]
>>
;
};
export
type
Knows
=
Glyph
&
{
__typename
:
'
Knows
'
;
_id
:
Scalars
[
'
ID
'
];
...
...
@@ -53,36 +28,10 @@ export type Knows = Glyph & {
_obj
:
Array
<
KnowsObject
>
;
};
export
type
Knows_SubjArgs
=
{
query
:
Maybe
<
KnowsSubjectQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
Knows_ObjArgs
=
{
query
:
Maybe
<
KnowsObjectQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
FollowsSubject
=
User
;
export
type
FollowsObject
=
User
;
export
type
FollowObjectQueryInput
=
{
User
:
Maybe
<
UserQueryInput
>
;
};
export
type
FollowSubjectQueryInput
=
{
User
:
Maybe
<
UserQueryInput
>
;
};
export
type
FollowsQueryInput
=
{
_and
:
Maybe
<
Array
<
FollowsQueryInput
>>
;
_or
:
Maybe
<
Array
<
FollowsQueryInput
>>
;
_id
:
Maybe
<
Array
<
Scalars
[
'
ID
'
]
>>
;
};
export
type
Follows
=
Glyph
&
{
__typename
:
'
Follows
'
;
_id
:
Scalars
[
'
ID
'
];
...
...
@@ -90,30 +39,6 @@ export type Follows = Glyph & {
_obj
:
Array
<
FollowsObject
>
;
};
export
type
Follows_SubjArgs
=
{
query
:
Maybe
<
FollowSubjectQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
Follows_ObjArgs
=
{
query
:
Maybe
<
FollowObjectQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
UserQueryInput
=
{
_and
:
Maybe
<
Array
<
UserQueryInput
>>
;
_or
:
Maybe
<
Array
<
UserQueryInput
>>
;
_id
:
Maybe
<
Array
<
Scalars
[
'
ID
'
]
>>
;
username
:
Maybe
<
StringMatchInput
>
;
};
export
type
UserRelationQueryInput
=
{
Follows
:
Maybe
<
FollowsQueryInput
>
;
Knows
:
Maybe
<
KnowsQueryInput
>
;
};
export
type
UserRelation
=
Knows
|
Follows
;
export
type
User
=
Glyph
&
{
...
...
@@ -123,29 +48,11 @@ export type User = Glyph & {
username
:
Scalars
[
'
String
'
];
};
export
type
User_RelArgs
=
{
query
:
Maybe
<
UserRelationQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
GraphQueryInput
=
{
Knows
:
Maybe
<
KnowsQueryInput
>
;
Follows
:
Maybe
<
FollowsQueryInput
>
;
User
:
Maybe
<
UserQueryInput
>
;
};
export
type
Query
=
{
__typename
:
'
Query
'
;
graph
:
Array
<
Glyph
>
;
};
export
type
QueryGraphArgs
=
{
query
:
Maybe
<
GraphQueryInput
>
;
page
:
Maybe
<
PageInput
>
;
};
export
type
CreateUserInput
=
{
username
:
Scalars
[
'
String
'
];
};
...
...
@@ -174,20 +81,6 @@ export type MutationCreateFollowsArgs = {
to
:
Scalars
[
'
ID
'
];
};
export
enum
Role
{
Anonymous
=
'
Anonymous
'
,
Admin
=
'
Admin
'
,
System
=
'
System
'
,
WebUser
=
'
WebUser
'
}
export
type
Auth
=
{
__typename
:
'
Auth
'
;
userId
:
Scalars
[
'
ID
'
];
token
:
Scalars
[
'
String
'
];
roles
:
Array
<
Role
>
;
};
export
type
ResolverTypeWrapper
<
T
>
=
Promise
<
T
>
|
T
;
...
...
@@ -268,32 +161,18 @@ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs
export
type
ResolversTypes
=
{
Glyph
:
ResolversTypes
[
'
Knows
'
]
|
ResolversTypes
[
'
Follows
'
]
|
ResolversTypes
[
'
User
'
];
ID
:
ResolverTypeWrapper
<
Scalars
[
'
ID
'
]
>
;
StringMatchInput
:
StringMatchInput
;
String
:
ResolverTypeWrapper
<
Scalars
[
'
String
'
]
>
;
PageInput
:
PageInput
;
Int
:
ResolverTypeWrapper
<
Scalars
[
'
Int
'
]
>
;
KnowsSubject
:
ResolversTypes
[
'
User
'
];
KnowsObject
:
ResolversTypes
[
'
User
'
];
KnowsSubjectQueryInput
:
KnowsSubjectQueryInput
;
KnowsObjectQueryInput
:
KnowsObjectQueryInput
;
KnowsQueryInput
:
KnowsQueryInput
;
Knows
:
ResolverTypeWrapper
<
Omit
<
Knows
,
'
_subj
'
|
'
_obj
'
>
&
{
_subj
:
Array
<
ResolversTypes
[
'
KnowsSubject
'
]
>
,
_obj
:
Array
<
ResolversTypes
[
'
KnowsObject
'
]
>
}
>
;
FollowsSubject
:
ResolversTypes
[
'
User
'
];
FollowsObject
:
ResolversTypes
[
'
User
'
];
FollowObjectQueryInput
:
FollowObjectQueryInput
;
FollowSubjectQueryInput
:
FollowSubjectQueryInput
;
FollowsQueryInput
:
FollowsQueryInput
;
Follows
:
ResolverTypeWrapper
<
Omit
<
Follows
,
'
_subj
'
|
'
_obj
'
>
&
{
_subj
:
Array
<
ResolversTypes
[
'
FollowsSubject
'
]
>
,
_obj
:
Array
<
ResolversTypes
[
'
FollowsObject
'
]
>
}
>
;
UserQueryInput
:
UserQueryInput
;
UserRelationQueryInput
:
UserRelationQueryInput
;
UserRelation
:
ResolversTypes
[
'
Knows
'
]
|
ResolversTypes
[
'
Follows
'
];
User
:
ResolverTypeWrapper
<
Omit
<
User
,
'
_rel
'
>
&
{
_rel
:
Array
<
ResolversTypes
[
'
UserRelation
'
]
>
}
>
;
GraphQueryInput
:
GraphQueryInput
;
String
:
ResolverTypeWrapper
<
Scalars
[
'
String
'
]
>
;
Query
:
ResolverTypeWrapper
<
RootValue
>
;
CreateUserInput
:
CreateUserInput
;
Mutation
:
ResolverTypeWrapper
<
RootValue
>
;
Role
:
Role
;
Auth
:
ResolverTypeWrapper
<
Auth
>
;
Boolean
:
ResolverTypeWrapper
<
Scalars
[
'
Boolean
'
]
>
;
};
...
...
@@ -301,31 +180,18 @@ export type ResolversTypes = {
export
type
ResolversParentTypes
=
{
Glyph
:
ResolversParentTypes
[
'
Knows
'
]
|
ResolversParentTypes
[
'
Follows
'
]
|
ResolversParentTypes
[
'
User
'
];
ID
:
Scalars
[
'
ID
'
];
StringMatchInput
:
StringMatchInput
;
String
:
Scalars
[
'
String
'
];
PageInput
:
PageInput
;
Int
:
Scalars
[
'
Int
'
];
KnowsSubject
:
ResolversParentTypes
[
'
User
'
];
KnowsObject
:
ResolversParentTypes
[
'
User
'
];
KnowsSubjectQueryInput
:
KnowsSubjectQueryInput
;
KnowsObjectQueryInput
:
KnowsObjectQueryInput
;
KnowsQueryInput
:
KnowsQueryInput
;
Knows
:
Omit
<
Knows
,
'
_subj
'
|
'
_obj
'
>
&
{
_subj
:
Array
<
ResolversParentTypes
[
'
KnowsSubject
'
]
>
,
_obj
:
Array
<
ResolversParentTypes
[
'
KnowsObject
'
]
>
};
FollowsSubject
:
ResolversParentTypes
[
'
User
'
];
FollowsObject
:
ResolversParentTypes
[
'
User
'
];
FollowObjectQueryInput
:
FollowObjectQueryInput
;
FollowSubjectQueryInput
:
FollowSubjectQueryInput
;
FollowsQueryInput
:
FollowsQueryInput
;
Follows
:
Omit
<
Follows
,
'
_subj
'
|
'
_obj
'
>
&
{
_subj
:
Array
<
ResolversParentTypes
[
'
FollowsSubject
'
]
>
,
_obj
:
Array
<
ResolversParentTypes
[
'
FollowsObject
'
]
>
};
UserQueryInput
:
UserQueryInput
;
UserRelationQueryInput
:
UserRelationQueryInput
;
UserRelation
:
ResolversParentTypes
[
'
Knows
'
]
|
ResolversParentTypes
[
'
Follows
'
];
User
:
Omit
<
User
,
'
_rel
'
>
&
{
_rel
:
Array
<
ResolversParentTypes
[
'
UserRelation
'
]
>
};
GraphQueryInput
:
GraphQueryInput
;
String
:
Scalars
[
'
String
'
]
;
Query
:
RootValue
;
CreateUserInput
:
CreateUserInput
;
Mutation
:
RootValue
;
Auth
:
Auth
;
Boolean
:
Scalars
[
'
Boolean
'
];
};
...
...
@@ -344,8 +210,8 @@ export type KnowsObjectResolvers<ContextType = Context, ParentType extends Resol
export
type
KnowsResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
Knows
'
]
=
ResolversParentTypes
[
'
Knows
'
]
>
=
{
_id
:
Resolver
<
ResolversTypes
[
'
ID
'
],
ParentType
,
ContextType
>
;
_subj
:
Resolver
<
Array
<
ResolversTypes
[
'
KnowsSubject
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
Knows_SubjArgs
,
never
>
>
;
_obj
:
Resolver
<
Array
<
ResolversTypes
[
'
KnowsObject
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
Knows_ObjArgs
,
never
>
>
;
_subj
:
Resolver
<
Array
<
ResolversTypes
[
'
KnowsSubject
'
]
>
,
ParentType
,
ContextType
>
;
_obj
:
Resolver
<
Array
<
ResolversTypes
[
'
KnowsObject
'
]
>
,
ParentType
,
ContextType
>
;
__isTypeOf
?:
IsTypeOfResolverFn
<
ParentType
,
ContextType
>
;
};
...
...
@@ -359,8 +225,8 @@ export type FollowsObjectResolvers<ContextType = Context, ParentType extends Res
export
type
FollowsResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
Follows
'
]
=
ResolversParentTypes
[
'
Follows
'
]
>
=
{
_id
:
Resolver
<
ResolversTypes
[
'
ID
'
],
ParentType
,
ContextType
>
;
_subj
:
Resolver
<
Array
<
ResolversTypes
[
'
FollowsSubject
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
Follows_SubjArgs
,
never
>
>
;
_obj
:
Resolver
<
Array
<
ResolversTypes
[
'
FollowsObject
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
Follows_ObjArgs
,
never
>
>
;
_subj
:
Resolver
<
Array
<
ResolversTypes
[
'
FollowsSubject
'
]
>
,
ParentType
,
ContextType
>
;
_obj
:
Resolver
<
Array
<
ResolversTypes
[
'
FollowsObject
'
]
>
,
ParentType
,
ContextType
>
;
__isTypeOf
?:
IsTypeOfResolverFn
<
ParentType
,
ContextType
>
;
};
...
...
@@ -370,13 +236,13 @@ export type UserRelationResolvers<ContextType = Context, ParentType extends Reso
export
type
UserResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
User
'
]
=
ResolversParentTypes
[
'
User
'
]
>
=
{
_id
:
Resolver
<
ResolversTypes
[
'
ID
'
],
ParentType
,
ContextType
>
;
_rel
:
Resolver
<
Array
<
ResolversTypes
[
'
UserRelation
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
User_RelArgs
,
never
>
>
;
_rel
:
Resolver
<
Array
<
ResolversTypes
[
'
UserRelation
'
]
>
,
ParentType
,
ContextType
>
;
username
:
Resolver
<
ResolversTypes
[
'
String
'
],
ParentType
,
ContextType
>
;
__isTypeOf
?:
IsTypeOfResolverFn
<
ParentType
,
ContextType
>
;
};
export
type
QueryResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
Query
'
]
=
ResolversParentTypes
[
'
Query
'
]
>
=
{
graph
:
Resolver
<
Array
<
ResolversTypes
[
'
Glyph
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
QueryGraphArgs
,
never
>
>
;
graph
:
Resolver
<
Array
<
ResolversTypes
[
'
Glyph
'
]
>
,
ParentType
,
ContextType
>
;
};
export
type
MutationResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
Mutation
'
]
=
ResolversParentTypes
[
'
Mutation
'
]
>
=
{
...
...
@@ -385,13 +251,6 @@ export type MutationResolvers<ContextType = Context, ParentType extends Resolver
createFollows
:
Resolver
<
Maybe
<
ResolversTypes
[
'
Follows
'
]
>
,
ParentType
,
ContextType
,
RequireFields
<
MutationCreateFollowsArgs
,
'
from
'
|
'
to
'
>>
;
};
export
type
AuthResolvers
<
ContextType
=
Context
,
ParentType
extends
ResolversParentTypes
[
'
Auth
'
]
=
ResolversParentTypes
[
'
Auth
'
]
>
=
{
userId
:
Resolver
<
ResolversTypes
[
'
ID
'
],
ParentType
,
ContextType
>
;
token
:
Resolver
<
ResolversTypes
[
'
String
'
],
ParentType
,
ContextType
>
;
roles
:
Resolver
<
Array
<
ResolversTypes
[
'
Role
'
]
>
,
ParentType
,
ContextType
>
;
__isTypeOf
?:
IsTypeOfResolverFn
<
ParentType
,
ContextType
>
;
};
export
type
Resolvers
<
ContextType
=
Context
>
=
{
Glyph
:
GlyphResolvers
<
ContextType
>
;
KnowsSubject
:
KnowsSubjectResolvers
<
ContextType
>
;
...
...
@@ -404,7 +263,6 @@ export type Resolvers<ContextType = Context> = {
User
:
UserResolvers
<
ContextType
>
;
Query
:
QueryResolvers
<
ContextType
>
;
Mutation
:
MutationResolvers
<
ContextType
>
;
Auth
:
AuthResolvers
<
ContextType
>
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment