Replies: 1 comment
-
Something like this will work:
TL;DR, As an example, if this is a webapp the above code would fail once you deploy it on an application server because the schema files would no longer be in that directory. Even if the directory path was relative, you wouldn't be able to reference it from inside the application server with jumping through hoops. It would depend on how your deployment artifacts are packaged. If you really need this functionality because... I don't know... and you want your application to be portable, you would have to do something more interesting. For example, use Google Guava's Even doing that is some bad mojo. So in the end, just list the file names and make sure the files are on your classpath. How many schema files can there be? :) |
Beta Was this translation helpful? Give feedback.
-
Hi guys,
Is it possible to use all .graphqls files from resources directory with SchemaParserBuilder. Something like this:
SchemaParser.newParser().files("*.graphqls")...
SchemaParserBuilder.files()
method accepts array of files, yet the type of the parameter is String.So when I try to include all the files as I mentioned above, I get this error:
java.io.FileNotFoundException: classpath:*.graphqls
Did anyone try to do this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions