File tree Expand file tree Collapse file tree
src/main/java/graphql/introspection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,8 +84,14 @@ public Object get(DataFetchingEnvironment environment) {
8484 .dataFetcher (new DataFetcher () {
8585 @ Override
8686 public Object get (DataFetchingEnvironment environment ) {
87- GraphQLInputObjectField inputField = (GraphQLInputObjectField ) environment .getSource ();
88- return inputField .getDefaultValue () != null ? inputField .getDefaultValue ().toString () : null ;
87+ if (environment .getSource () instanceof GraphQLArgument ) {
88+ GraphQLArgument inputField = (GraphQLArgument ) environment .getSource ();
89+ return inputField .getDefaultValue () != null ? inputField .getDefaultValue ().toString () : null ;
90+ } else if (environment .getSource () instanceof GraphQLInputObjectField ) {
91+ GraphQLInputObjectField inputField = (GraphQLInputObjectField ) environment .getSource ();
92+ return inputField .getDefaultValue () != null ? inputField .getDefaultValue ().toString () : null ;
93+ }
94+ return null ;
8995 }
9096 })
9197 .build ())
You can’t perform that action at this time.
0 commit comments