mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-23 16:24:21 +01:00
feat: add projects card to user profile
This commit is contained in:
@@ -548,6 +548,7 @@ export interface NexusGenFieldTypes {
|
||||
name: string; // String!
|
||||
nostr_prv_key: string | null; // String
|
||||
nostr_pub_key: string | null; // String
|
||||
projects: NexusGenRootTypes['Project'][]; // [Project!]!
|
||||
role: string | null; // String
|
||||
roles: NexusGenRootTypes['MakerRole'][]; // [MakerRole!]!
|
||||
similar_makers: NexusGenRootTypes['User'][]; // [User!]!
|
||||
@@ -744,6 +745,7 @@ export interface NexusGenFieldTypes {
|
||||
linkedin: string | null; // String
|
||||
location: string | null; // String
|
||||
name: string; // String!
|
||||
projects: NexusGenRootTypes['Project'][]; // [Project!]!
|
||||
role: string | null; // String
|
||||
roles: NexusGenRootTypes['MakerRole'][]; // [MakerRole!]!
|
||||
similar_makers: NexusGenRootTypes['User'][]; // [User!]!
|
||||
@@ -781,6 +783,7 @@ export interface NexusGenFieldTypes {
|
||||
linkedin: string | null; // String
|
||||
location: string | null; // String
|
||||
name: string; // String!
|
||||
projects: NexusGenRootTypes['Project'][]; // [Project!]!
|
||||
role: string | null; // String
|
||||
roles: NexusGenRootTypes['MakerRole'][]; // [MakerRole!]!
|
||||
similar_makers: NexusGenRootTypes['User'][]; // [User!]!
|
||||
@@ -937,6 +940,7 @@ export interface NexusGenFieldTypeNames {
|
||||
name: 'String'
|
||||
nostr_prv_key: 'String'
|
||||
nostr_pub_key: 'String'
|
||||
projects: 'Project'
|
||||
role: 'String'
|
||||
roles: 'MakerRole'
|
||||
similar_makers: 'User'
|
||||
@@ -1133,6 +1137,7 @@ export interface NexusGenFieldTypeNames {
|
||||
linkedin: 'String'
|
||||
location: 'String'
|
||||
name: 'String'
|
||||
projects: 'Project'
|
||||
role: 'String'
|
||||
roles: 'MakerRole'
|
||||
similar_makers: 'User'
|
||||
@@ -1170,6 +1175,7 @@ export interface NexusGenFieldTypeNames {
|
||||
linkedin: 'String'
|
||||
location: 'String'
|
||||
name: 'String'
|
||||
projects: 'Project'
|
||||
role: 'String'
|
||||
roles: 'MakerRole'
|
||||
similar_makers: 'User'
|
||||
|
||||
@@ -31,6 +31,7 @@ interface BaseUser {
|
||||
linkedin: String
|
||||
location: String
|
||||
name: String!
|
||||
projects: [Project!]!
|
||||
role: String
|
||||
roles: [MakerRole!]!
|
||||
similar_makers: [User!]!
|
||||
@@ -216,6 +217,7 @@ type MyProfile implements BaseUser {
|
||||
name: String!
|
||||
nostr_prv_key: String
|
||||
nostr_pub_key: String
|
||||
projects: [Project!]!
|
||||
role: String
|
||||
roles: [MakerRole!]!
|
||||
similar_makers: [User!]!
|
||||
@@ -554,6 +556,7 @@ type User implements BaseUser {
|
||||
linkedin: String
|
||||
location: String
|
||||
name: String!
|
||||
projects: [Project!]!
|
||||
role: String
|
||||
roles: [MakerRole!]!
|
||||
similar_makers: [User!]!
|
||||
|
||||
@@ -72,6 +72,19 @@ const BaseUser = interfaceType({
|
||||
}).then(d => d.map(item => item.tournament))
|
||||
}
|
||||
})
|
||||
t.nonNull.list.nonNull.field('projects', {
|
||||
type: "Project",
|
||||
resolve: async (parent) => {
|
||||
return prisma.projectMember.findMany({
|
||||
where: {
|
||||
userId: parent.id
|
||||
},
|
||||
include: {
|
||||
project: true
|
||||
}
|
||||
}).then(d => d.map(item => item.project))
|
||||
}
|
||||
})
|
||||
t.nonNull.list.nonNull.field('similar_makers', {
|
||||
type: "User",
|
||||
resolve(parent,) {
|
||||
|
||||
Reference in New Issue
Block a user