Skip to content

Commit

Permalink
test: GraphQL integration tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat authored and mirceanis committed Sep 7, 2020
1 parent 967b916 commit 46fd3a2
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
81 changes: 81 additions & 0 deletions packages/daf-graphql/src/methods/data-store-orm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { IAgentGraphQLMethod } from '../types'

export const dataStoreORMGetMessages: IAgentGraphQLMethod = {
type: 'Query',
query: `
query dataStoreORMGetMessages($where: [MessagesWhere], $order: [MessagesOrder], $take: Int, $skip: Int) {
dataStoreORMGetMessages(where: $where, order: $order, take: $take, skip: $skip) {
id
createdAt
expiresAt
threadId
type
raw
data
replyTo
replyUrl
from
to
metaData {
type
value
}
}
}
`,
typeDef: `
enum WhereOperation {
Not
LessThan
LessThanOrEqual
MoreThan
MoreThanOrEqual
Equal
Like
Between
In
Any
IsNull
}
enum OrderDirection {
ASC
DESC
}
enum MessagesColumns {
from
to
id
createdAt
expiresAt
threadId
type
raw
replyTo
replyUrl
}
input MessagesWhere {
column: MessagesColumns!
value: [String]
not: Boolean
op: WhereOperation
}
input MessagesOrder {
column: MessagesColumns!
direction: OrderDirection!
}
extend type Query {
dataStoreORMGetMessages(where: [MessagesWhere], order: [MessagesOrder], take: Int, skip: Int): [Message]
}
`,
}

export const supportedMethods: Record<string, IAgentGraphQLMethod> = {
dataStoreORMGetMessages,
}

export default supportedMethods
4 changes: 4 additions & 0 deletions packages/daf-graphql/src/methods/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import identityManager from './identity-manager'
import resolver from './resolver'
import messageHandler from './message-handler'
import w3c from './w3c'
import sdr from './sdr'
import dataStoreORM from './data-store-orm'

export const supportedMethods: Record<string, IAgentGraphQLMethod> = {
...identityManager,
...resolver,
...messageHandler,
...w3c,
...sdr,
...dataStoreORM,
}
23 changes: 23 additions & 0 deletions packages/daf-graphql/src/methods/sdr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { IAgentGraphQLMethod } from '../types'

export const getVerifiableCredentialsForSdr: IAgentGraphQLMethod = {
type: 'Query',
query: `
query getVerifiableCredentialsForSdr($sdr: SelectiveDisclosureRequest!, $did: String) {
getVerifiableCredentialsForSdr(sdr: $sdr, did: $did)
}
`,
typeDef: `
scalar SelectiveDisclosureRequest
scalar CredentialsForSdr
extend type Query {
getVerifiableCredentialsForSdr(sdr: SelectiveDisclosureRequest!, did: String): [CredentialsForSdr]
}
`,
}

export const supportedMethods: Record<string, IAgentGraphQLMethod> = {
getVerifiableCredentialsForSdr,
}

export default supportedMethods

0 comments on commit 46fd3a2

Please sign in to comment.