mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-18 14:54:23 +01:00
Merge branch 'master' into dev
This commit is contained in:
@@ -271,6 +271,7 @@ export interface NexusGenObjects {
|
||||
payment_request: string; // String!
|
||||
}
|
||||
WalletKey: { // root type
|
||||
is_current: boolean; // Boolean!
|
||||
key: string; // String!
|
||||
name: string; // String!
|
||||
}
|
||||
@@ -544,6 +545,7 @@ export interface NexusGenFieldTypes {
|
||||
payment_request: string; // String!
|
||||
}
|
||||
WalletKey: { // field return type
|
||||
is_current: boolean; // Boolean!
|
||||
key: string; // String!
|
||||
name: string; // String!
|
||||
}
|
||||
@@ -835,6 +837,7 @@ export interface NexusGenFieldTypeNames {
|
||||
payment_request: 'String'
|
||||
}
|
||||
WalletKey: { // field return type name
|
||||
is_current: 'Boolean'
|
||||
key: 'String'
|
||||
name: 'String'
|
||||
}
|
||||
|
||||
@@ -382,6 +382,7 @@ type Vote {
|
||||
}
|
||||
|
||||
type WalletKey {
|
||||
is_current: Boolean!
|
||||
key: String!
|
||||
name: String!
|
||||
}
|
||||
@@ -171,9 +171,9 @@ const MyProfile = objectType({
|
||||
|
||||
t.nonNull.list.nonNull.field('walletsKeys', {
|
||||
type: "WalletKey",
|
||||
resolve: (parent) => {
|
||||
return prisma.user.findUnique({ where: { id: parent.id } }).userKeys();
|
||||
|
||||
resolve: async (parent, _, context) => {
|
||||
const userKeys = await prisma.user.findUnique({ where: { id: parent.id } }).userKeys();
|
||||
return userKeys.map(k => ({ ...k, is_current: k.key === context.userPubKey }))
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -283,6 +283,7 @@ const WalletKey = objectType({
|
||||
definition(t) {
|
||||
t.nonNull.string('key');
|
||||
t.nonNull.string('name');
|
||||
t.nonNull.boolean('is_current')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user