@@ -830,7 +830,6 @@ describe('Introspection', () => {
830
830
directives : [
831
831
{
832
832
name : 'include' ,
833
- repeatable : false ,
834
833
locations : [ 'FIELD' , 'FRAGMENT_SPREAD' , 'INLINE_FRAGMENT' ] ,
835
834
args : [
836
835
{
@@ -850,7 +849,6 @@ describe('Introspection', () => {
850
849
} ,
851
850
{
852
851
name : 'skip' ,
853
- repeatable : false ,
854
852
locations : [ 'FIELD' , 'FRAGMENT_SPREAD' , 'INLINE_FRAGMENT' ] ,
855
853
args : [
856
854
{
@@ -870,7 +868,6 @@ describe('Introspection', () => {
870
868
} ,
871
869
{
872
870
name : 'deprecated' ,
873
- repeatable : false ,
874
871
locations : [ 'FIELD_DEFINITION' , 'ENUM_VALUE' ] ,
875
872
args : [
876
873
{
@@ -890,6 +887,81 @@ describe('Introspection', () => {
890
887
} ) ;
891
888
} ) ;
892
889
890
+ it ( 'includes repeatable flag on directives' , ( ) => {
891
+ const EmptySchema = new GraphQLSchema ( {
892
+ query : new GraphQLObjectType ( {
893
+ name : 'QueryRoot' ,
894
+ fields : {
895
+ onlyField : { type : GraphQLString } ,
896
+ } ,
897
+ } ) ,
898
+ } ) ;
899
+ const query = getIntrospectionQuery ( {
900
+ descriptions : false ,
901
+ directiveRepeatableFlag : true ,
902
+ } ) ;
903
+ const result = graphqlSync ( EmptySchema , query ) ;
904
+
905
+ expect ( ( result . data : any ) . __schema . directives ) . to . deep . equal ( [
906
+ {
907
+ name : 'include' ,
908
+ locations : [ 'FIELD' , 'FRAGMENT_SPREAD' , 'INLINE_FRAGMENT' ] ,
909
+ args : [
910
+ {
911
+ name : 'if' ,
912
+ type : {
913
+ kind : 'NON_NULL' ,
914
+ name : null ,
915
+ ofType : {
916
+ kind : 'SCALAR' ,
917
+ name : 'Boolean' ,
918
+ ofType : null ,
919
+ } ,
920
+ } ,
921
+ defaultValue : null ,
922
+ } ,
923
+ ] ,
924
+ repeatable : false ,
925
+ } ,
926
+ {
927
+ name : 'skip' ,
928
+ locations : [ 'FIELD' , 'FRAGMENT_SPREAD' , 'INLINE_FRAGMENT' ] ,
929
+ args : [
930
+ {
931
+ name : 'if' ,
932
+ type : {
933
+ kind : 'NON_NULL' ,
934
+ name : null ,
935
+ ofType : {
936
+ kind : 'SCALAR' ,
937
+ name : 'Boolean' ,
938
+ ofType : null ,
939
+ } ,
940
+ } ,
941
+ defaultValue : null ,
942
+ } ,
943
+ ] ,
944
+ repeatable : false ,
945
+ } ,
946
+ {
947
+ name : 'deprecated' ,
948
+ locations : [ 'FIELD_DEFINITION' , 'ENUM_VALUE' ] ,
949
+ args : [
950
+ {
951
+ name : 'reason' ,
952
+ type : {
953
+ kind : 'SCALAR' ,
954
+ name : 'String' ,
955
+ ofType : null ,
956
+ } ,
957
+ defaultValue : '"No longer supported"' ,
958
+ } ,
959
+ ] ,
960
+ repeatable : false ,
961
+ } ,
962
+ ] ) ;
963
+ } ) ;
964
+
893
965
it ( 'introspects on input object' , ( ) => {
894
966
const TestInputObject = new GraphQLInputObjectType ( {
895
967
name : 'TestInputObject' ,
0 commit comments