1- import { extendType , objectType } from 'nexus' ;
21import { AuthenticationError } from 'apollo-server' ;
2+ import { extendType , objectType } from 'nexus' ;
33
44import { ruleType } from '../../src' ;
55
66export const Test = objectType ( {
77 name : 'Test' ,
88 shield : ruleType ( {
9- resolve ( _root , _args , _ctx ) {
9+ resolve ( _source , _args , _ctx ) {
1010 throw new AuthenticationError ( 'OBJECT' ) ;
1111 } ,
1212 } ) ,
1313 definition ( t ) {
1414 t . string ( 'publicProp' , {
1515 shield : ruleType ( {
16- resolve ( _root , _args , _ctx ) {
16+ resolve ( _source , _args , _ctx ) {
1717 return true ;
1818 } ,
1919 } ) ,
2020 } ) ;
2121 t . string ( 'privateProp' , {
2222 shield : ruleType ( {
23- resolve ( _root , _args , _ctx ) {
23+ resolve ( _source , _args , _ctx ) {
2424 return false ;
2525 } ,
2626 } ) ,
2727 } ) ;
2828 t . string ( 'throwProp' , {
2929 shield : ruleType ( {
30- resolve ( _root , _args , _ctx ) {
30+ resolve ( _source , _args , _ctx ) {
3131 throw new AuthenticationError ( 'CUSTOM' ) ;
3232 } ,
3333 } ) ,
@@ -41,7 +41,7 @@ export const QueryTest = extendType({
4141 definition ( t ) {
4242 t . field ( 'test' , {
4343 type : Test ,
44- resolve ( _root , _args , _ctx ) {
44+ resolve ( _source , _args , _ctx ) {
4545 return {
4646 publicProp : 'public' ,
4747 privateProp : 'private' ,
0 commit comments