File tree Expand file tree Collapse file tree 7 files changed +3752
-2939
lines changed Expand file tree Collapse file tree 7 files changed +3752
-2939
lines changed Original file line number Diff line number Diff line change 11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
33exports [` getDirectiveDeclaration should be defined 1` ] = `
4- GraphQLDirective {
5- " args" : Array [
6- Object {
4+ Object {
5+ " args" : Object {
6+ " role " : Object {
77 " astNode" : undefined ,
88 " defaultValue" : undefined ,
9- " description" : null ,
10- " name " : " role " ,
9+ " description" : undefined ,
10+ " extensions " : undefined ,
1111 " type" : " String" ,
1212 },
13- ] ,
13+ } ,
1414 " astNode" : undefined ,
1515 " description" : undefined ,
16+ " extensions" : undefined ,
17+ " isRepeatable" : false ,
1618 " locations" : Array [
1719 " FIELD_DEFINITION" ,
1820 ],
Original file line number Diff line number Diff line change 11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
33exports [` getDirectiveDeclaration should be defined 1` ] = `
4- GraphQLDirective {
5- " args" : Array [] ,
4+ Object {
5+ " args" : Object {} ,
66 " astNode" : undefined ,
77 " description" : undefined ,
8+ " extensions" : undefined ,
9+ " isRepeatable" : false ,
810 " locations" : Array [
911 " FIELD_DEFINITION" ,
1012 ],
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ beforeAll(() => {
88} ) ;
99
1010test ( 'getDirectiveDeclaration should be defined' , ( ) => {
11- expect ( AuthDirective ( ) . hasRole . getDirectiveDeclaration ( ) ) . toMatchSnapshot ( ) ;
11+ expect ( AuthDirective ( ) . hasRole . getDirectiveDeclaration ( ) . toConfig ( ) ) . toMatchSnapshot ( ) ;
1212} ) ;
1313
1414test ( 'if throw error if no role inside token payload' , ( ) =>
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ beforeAll(() => {
99
1010test ( 'getDirectiveDeclaration should be defined' , ( ) => {
1111 expect (
12- AuthDirective ( ) . isAuthenticated . getDirectiveDeclaration ( )
12+ AuthDirective ( ) . isAuthenticated . getDirectiveDeclaration ( ) . toConfig ( )
1313 ) . toMatchSnapshot ( ) ;
1414} ) ;
1515
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { AuthDirective } from '../src/index';
33import { makeExecutableSchema } from 'graphql-tools' ;
44
55const typeDefs = gql `
6+ directive @isAuthenticated on FIELD_DEFINITION
7+ directive @hasRole(role: String) on FIELD_DEFINITION
8+
69 type User {
710 id: ID!
811 username: String!
Original file line number Diff line number Diff line change 3636 "@babel/preset-env" : " ^7.1.0" ,
3737 "@babel/preset-typescript" : " ^7.1.0" ,
3838 "@babel/register" : " ^7.0.0" ,
39- "@types/graphql" : " ^14.0.3" ,
4039 "@types/jsonwebtoken" : " ^7.2.8" ,
4140 "apollo-server-express" : " ^2.0.0" ,
4241 "body-parser" : " ^1.18.3" ,
4342 "eslint" : " ^5.2.0" ,
4443 "eslint-config-callstack-io" : " ^1.1.2" ,
4544 "express" : " ^4.16.4" ,
46- "graphql" : " ^0.13.2 " ,
47- "graphql-tools" : " ^3 .0.5 " ,
48- "jest" : " ^23.6 .0" ,
45+ "graphql" : " ^15.0.0 " ,
46+ "graphql-tools" : " ^5 .0.0 " ,
47+ "jest" : " ^25.4 .0" ,
4948 "mock-express-request" : " ^0.2.2" ,
5049 "nock" : " ^10.0.2" ,
5150 "nodemon" : " ^1.18.7" ,
52- "ts-jest" : " ^23.10.4 " ,
51+ "ts-jest" : " ^25.4.0 " ,
5352 "typescript" : " ^3.1.6"
5453 },
5554 "dependencies" : {
You can’t perform that action at this time.
0 commit comments