Skip to content

Commit

Permalink
Merge pull request #36 from alkem-io/codegen
Browse files Browse the repository at this point in the history
Adding codegen and map subspace types
  • Loading branch information
valentinyanakiev authored Jun 27, 2024
2 parents b7a95ee + 49ac567 commit 99de749
Show file tree
Hide file tree
Showing 17 changed files with 15,732 additions and 88 deletions.
33 changes: 33 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
overwrite: true
schema: "http://localhost:3000/graphql"
documents:
- "src/**/*.graphql"
- graphql/**/*.graphql
hooks:
afterAllFileWrite:
- eslint --fix
- prettier --write
generates:
src/generated/graphql.ts:
plugins:
- add:
content: '/* eslint-disable @typescript-eslint/no-explicit-any */'
- typescript
- typescript-resolvers
- typescript-operations
- typescript-graphql-request
config:
maybeValue: T | undefined
rawRequest: true
preResolveTypes: true
skipTypename: true
scalars:
Upload: import('graphql-upload').FileUpload
NameID: string
UUID: string
UUID_NAMEID: string
UUID_NAMEID_EMAIL: string
DID: string
DateTime: Date
JSON: string

10 changes: 10 additions & 0 deletions graphql/document.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
query document($documentID: UUID!){
lookup {
document(ID: $documentID) {
id
mimeType
url
displayName
}
}
}
22 changes: 22 additions & 0 deletions graphql/fragments/space-details.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
fragment SpaceDetails on Space {
id
nameID
profile {
displayName
visuals {
name
id
}
tagset {
tags
id
name
}
}
community {
id
}
context {
id
}
}
102 changes: 102 additions & 0 deletions graphql/fragments/space-ingest.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
fragment SpaceIngest on Space {
id
nameID
type
profile {
description
displayName
tagline
url
location {
city
country
postalCode
}
tagset {
tags
}
references {
description
name
uri
}
visuals {
uri
name
}
}
context {
vision
impact
who
}

collaboration {
callouts {
id
nameID
type
comments {
messagesCount
messages {
sender {
... on User {
profile {
url
displayName
}
}
... on VirtualContributor {
profile {
url
displayName
}
}
}
message
timestamp
}
}
framing {
profile {
description
displayName
tagline
url
tagset {
tags
}
references {
description
name
uri
}
visuals {
uri
name
}
}
}
contributions {
link {
uri
profile {
description
displayName
url
type
references {
description
name
uri
}
visuals {
uri
name
}
}
}
}
}
}
}
95 changes: 95 additions & 0 deletions graphql/queries/me.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
query me {
me {
user {
...UserDetails
...UserAgent
__typename
}
__typename
}
}

fragment UserDetails on User {
id
nameID
firstName
lastName
email
gender
phone
accountUpn
agent {
credentials {
type
resourceID
__typename
}
__typename
}
profile {
id
displayName
tagline
location {
country
city
__typename
}
description
visual(type: AVATAR) {
...VisualFull
__typename
}
references {
id
name
uri
description
__typename
}
tagsets {
...TagsetDetails
__typename
}
__typename
}
__typename
}

fragment VisualFull on Visual {
id
uri
name
allowedTypes
aspectRatio
maxHeight
maxWidth
minHeight
minWidth
alternativeText
__typename
}

fragment TagsetDetails on Tagset {
id
name
tags
allowedValues
type
__typename
}

fragment UserAgent on User {
agent {
id
did
credentials {
id
resourceID
type
__typename
}
__typename
}
__typename
}
13 changes: 13 additions & 0 deletions graphql/queries/space-ingest.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
query spaceIngest($spaceID: UUID!){
lookup {
space(ID: $spaceID) {
...SpaceIngest
subspaces {
...SpaceIngest
subspaces {
...SpaceIngest
}
}
}
}
}
Loading

0 comments on commit 99de749

Please sign in to comment.