-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Throw error when no schema nor operation files are found #2618
Conversation
✅ Deploy Preview for apollo-ios-docs canceled.
|
@@ -56,12 +62,14 @@ public class ApolloCodegen { | |||
rootURL: rootURL | |||
) | |||
|
|||
try validate(config: configContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've separated these two validate
calls because the first one includes path syntax validation and should be done before compilation of the schema + operations. The second validation (line 72) ensures no schema name conflict.
I don't like that they're now separate, some ideas to improve:
- rename the second one from
validate
to something else - move the schema name logic somewhere else
@@ -191,7 +191,7 @@ public struct Glob { | |||
globfree(&globT) | |||
} | |||
|
|||
CodegenLogger.log("Matching \(pattern)", logLevel: .debug) | |||
CodegenLogger.log("Evaluating \(pattern)", logLevel: .debug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matching
was too close to Matched
. Evaluating
is more indicative of what the logic is actually doing.
7899de8
to
8d66723
Compare
Closes #2567
When a schema file could not be found graphql-js would emit errors but they were not indicative of the underlying problem. I've added validation to ensure that at least one match of the schema/operation search paths is found otherwise an error is thrown.