Commit ef3c0200 authored by aleclofabbro's avatar aleclofabbro
Browse files

kinda, migrating to top recursive query arg

parent 8a494d97
......@@ -2,10 +2,12 @@
directive @graphEntry on FIELD_DEFINITION
interface Glyph {
_id(id: ID): ID!
_id: ID!
}
input StringMatch {
eq: String
gt: String
lt: String
}
input PageArg {
limit: Int
......@@ -14,29 +16,57 @@ input PageArg {
union Knower = User
union Knowable = User
input KnowsFilter {
and: [KnowsFilter!]
or: [KnowsFilter!]
_subj: [UserFilter!]
_obj: [UserFilter!]
_page: PageArg
}
type Knows implements Glyph {
_id(id: ID): ID!
_subj(id: ID): [Knower!]!
_obj(id: ID): [Knowable!]!
_id: ID!
_subj: [Knower!]!
_obj: [Knowable!]!
}
# union Follower = User
# union Followable = User
# type Follows {
# _id: ID!
# _kind: GlyphKind!
# subj: Follower!
# obj: Followable!
# }
union Follower = User
union Followable = User
input FollowsFilter {
and: [FollowsFilter!]
or: [FollowsFilter!]
_subj: [UserFilter!]
_obj: [UserFilter!]
_page: PageArg
}
type Follows implements Glyph {
_id: ID!
_subj: [Follower!]!
_obj: [Followable!]!
}
union UserRelation = Knows #|Follows
input UserFilter {
and: [UserFilter!]
or: [UserFilter!]
_id: ID
username: StringMatch
_rel: [UserRelationFilter!]
_page: PageArg
}
input UserRelationFilter {
alias: String!
follows: FollowsFilter
knows: KnowsFilter
}
union UserRelation = Knows | Follows
type User implements Glyph {
_id(id: ID): ID!
_id: ID!
_rel(page: PageArg): [UserRelation!]!
username(match: StringMatch): String!
username: String!
}
type Query {
user: [User!]! @graphEntry
user(match: UserFilter): [User!]! @graphEntry
da: Query!
}
input UserInput {
......
......@@ -16,18 +16,7 @@
{
"name": "_id",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
}
],
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -50,6 +39,11 @@
"name": "Knows",
"ofType": null
},
{
"kind": "OBJECT",
"name": "Follows",
"ofType": null
},
{
"kind": "OBJECT",
"name": "User",
......@@ -82,6 +76,26 @@
"ofType": null
},
"defaultValue": null
},
{
"name": "gt",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "lt",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
......@@ -171,6 +185,99 @@
}
]
},
{
"kind": "INPUT_OBJECT",
"name": "KnowsFilter",
"description": null,
"fields": null,
"inputFields": [
{
"name": "and",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "KnowsFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "or",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "KnowsFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_subj",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_obj",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_page",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "PageArg",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Knows",
......@@ -179,18 +286,7 @@
{
"name": "_id",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
}
],
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -206,18 +302,7 @@
{
"name": "_subj",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
}
],
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -241,18 +326,189 @@
{
"name": "_obj",
"description": null,
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "UNION",
"name": "Knowable",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
{
"kind": "INTERFACE",
"name": "Glyph",
"ofType": null
}
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "UNION",
"name": "Follower",
"description": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": [
{
"kind": "OBJECT",
"name": "User",
"ofType": null
}
]
},
{
"kind": "UNION",
"name": "Followable",
"description": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": [
{
"kind": "OBJECT",
"name": "User",
"ofType": null
}
]
},
{
"kind": "INPUT_OBJECT",
"name": "FollowsFilter",
"description": null,
"fields": null,
"inputFields": [
{
"name": "and",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "FollowsFilter",
"ofType": null
},
"defaultValue": null
}
}
],
},
"defaultValue": null
},
{
"name": "or",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "FollowsFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_subj",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_obj",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_page",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "PageArg",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Follows",
"description": null,
"fields": [
{
"name": "_id",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "_subj",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -264,7 +520,31 @@
"name": null,
"ofType": {
"kind": "UNION",
"name": "Knowable",
"name": "Follower",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "_obj",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "UNION",
"name": "Followable",
"ofType": null
}
}
......@@ -285,6 +565,146 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"description": null,
"fields": null,
"inputFields": [
{
"name": "and",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "or",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
},
{
"name": "username",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "StringMatch",
"ofType": null
},
"defaultValue": null
},
{
"name": "_rel",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "UserRelationFilter",
"ofType": null
}
}
},
"defaultValue": null
},
{
"name": "_page",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "PageArg",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{