File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ const typeDefs = `
30
30
input BookInput {
31
31
title: String! @constraint(minLength: 5, format: "email")
32
32
}`
33
- const schema = makeExecutableSchema ({
33
+
34
+ let schema = makeExecutableSchema ({
34
35
typeDefs: [constraintDirectiveTypeDefs, typeDefs],
35
- schemaTransforms: [constraintDirective ()]
36
36
})
37
+ schema = constraintDirective ()(schema)
38
+
37
39
const app = express ()
38
40
const server = new ApolloServer ({ schema })
39
41
Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ const request = require('supertest')
5
5
const { constraintDirective, constraintDirectiveTypeDefs } = require ( '../' )
6
6
7
7
module . exports = function ( typeDefs , formatError , resolvers ) {
8
- const schema = makeExecutableSchema ( {
8
+ let schema = makeExecutableSchema ( {
9
9
typeDefs : [ constraintDirectiveTypeDefs , typeDefs ] ,
10
- schemaTransforms : [ constraintDirective ( ) ] ,
11
10
resolvers
12
11
} )
12
+ schema = constraintDirective ( ) ( schema )
13
+
13
14
const app = express ( )
14
15
const server = new ApolloServer ( { schema, formatError } )
15
16
You can’t perform that action at this time.
0 commit comments