Skip to content
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
7 changes: 6 additions & 1 deletion api-js/src/email-scan/objects/dkim-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { GraphQLJSON } from 'graphql-scalars'

import { dkimType } from './dkim'
import { nodeInterface } from '../../node'
import { guidanceTagConnection } from '../../guidance-tag'
import { guidanceTagOrder } from '../../guidance-tag/inputs'
import { guidanceTagConnection } from '../../guidance-tag/objects'

export const dkimResultType = new GraphQLObjectType({
name: 'DKIMResult',
Expand Down Expand Up @@ -47,6 +48,10 @@ export const dkimResultType = new GraphQLObjectType({
guidanceTags: {
type: guidanceTagConnection.connectionType,
args: {
orderBy: {
type: guidanceTagOrder,
description: 'Ordering options for guidance tag connections',
},
...connectionArgs,
},
description: 'Key tags found during scan.',
Expand Down
7 changes: 6 additions & 1 deletion api-js/src/email-scan/objects/dmarc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { GraphQLJSON } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
import { guidanceTagConnection } from '../../guidance-tag'
import { guidanceTagOrder } from '../../guidance-tag/inputs'
import { guidanceTagConnection } from '../../guidance-tag/objects'

export const dmarcType = new GraphQLObjectType({
name: 'DMARC',
Expand Down Expand Up @@ -59,6 +60,10 @@ subdomains where mail is failing the DMARC authentication and alignment checks.`
guidanceTags: {
type: guidanceTagConnection.connectionType,
args: {
orderBy: {
type: guidanceTagOrder,
description: 'Ordering options for guidance tag connections',
},
...connectionArgs,
},
description: `Key tags found during DMARC Scan.`,
Expand Down
7 changes: 6 additions & 1 deletion api-js/src/email-scan/objects/spf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { GraphQLJSON } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
import { guidanceTagConnection } from '../../guidance-tag'
import { guidanceTagOrder } from '../../guidance-tag/inputs'
import { guidanceTagConnection } from '../../guidance-tag/objects'

export const spfType = new GraphQLObjectType({
name: 'SPF',
Expand Down Expand Up @@ -52,6 +53,10 @@ export const spfType = new GraphQLObjectType({
guidanceTags: {
type: guidanceTagConnection.connectionType,
args: {
orderBy: {
type: guidanceTagOrder,
description: 'Ordering options for guidance tag connections',
},
...connectionArgs,
},
description: `Key tags found during scan.`,
Expand Down
20 changes: 20 additions & 0 deletions api-js/src/enums/guidance-tag-order-field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { GraphQLEnumType } from 'graphql'

export const GuidanceTagOrderField = new GraphQLEnumType({
name: 'GuidanceTagOrderField',
description: 'Properties by which Guidance Tag connections can be ordered.',
values: {
TAG_ID: {
value: 'tag-id',
description: 'Order guidance tag edges by tag id.',
},
TAG_NAME: {
value: 'tag-name',
description: 'Order guidance tag edges by tag name.',
},
GUIDANCE: {
value: 'guidance',
description: 'Order guidance tag edges by tag guidance.',
},
},
})
1 change: 1 addition & 0 deletions api-js/src/enums/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './dkim-result-order-field'
export * from './dmarc-order-field'
export * from './dmarc-summary-order-field'
export * from './domain-order-field'
export * from './guidance-tag-order-field'
export * from './https-order-field'
export * from './languages'
export * from './order-direction'
Expand Down
1 change: 1 addition & 0 deletions api-js/src/guidance-tag/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './inputs'
export * from './loaders'
export * from './objects'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { GraphQLNonNull } from 'graphql'

import { guidanceTagOrder } from '../guidance-tag-order'
import { OrderDirection, GuidanceTagOrderField } from '../../../enums'

describe('given the guidanceTagOrder input object', () => {
describe('testing fields', () => {
it('has a direction field', () => {
const demoType = guidanceTagOrder.getFields()

expect(demoType).toHaveProperty('direction')
expect(demoType.direction.type).toMatchObject(
GraphQLNonNull(OrderDirection),
)
})
it('has a field field', () => {
const demoType = guidanceTagOrder.getFields()

expect(demoType).toHaveProperty('field')
expect(demoType.field.type).toMatchObject(
GraphQLNonNull(GuidanceTagOrderField),
)
})
})
})
18 changes: 18 additions & 0 deletions api-js/src/guidance-tag/inputs/guidance-tag-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'

import { OrderDirection, GuidanceTagOrderField } from '../../enums'

export const guidanceTagOrder = new GraphQLInputObjectType({
name: 'GuidanceTagOrder',
description: 'Ordering options for guidance tag connections.',
fields: () => ({
field: {
type: GraphQLNonNull(GuidanceTagOrderField),
description: 'The field to order guidance tags by.',
},
direction: {
type: GraphQLNonNull(OrderDirection),
description: 'The ordering direction.',
},
}),
})
1 change: 1 addition & 0 deletions api-js/src/guidance-tag/inputs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './guidance-tag-order'
Loading