Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding codegen and map subspace types #36

Merged
merged 6 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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