Skip to content

Commit 0b0924a

Browse files
authored
Fix "no schema found" error message (#5106)
* Fix "no schema found" error message * remove obsolete file * remove obsolete class
1 parent c7e4f8e commit 0b0924a

File tree

3 files changed

+4
-77
lines changed

3 files changed

+4
-77
lines changed

libraries/apollo-compiler/api/apollo-compiler.api

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ public final class com/apollographql/apollo3/compiler/ExpressionAdapterInitializ
101101
public final fun serializer ()Lkotlinx/serialization/KSerializer;
102102
}
103103

104-
public final class com/apollographql/apollo3/compiler/IncomingOptions {
105-
public static final field Companion Lcom/apollographql/apollo3/compiler/IncomingOptions$Companion;
106-
public fun <init> (Lcom/apollographql/apollo3/ast/Schema;Ljava/lang/String;Ljava/lang/String;)V
107-
public final fun getCodegenModels ()Ljava/lang/String;
108-
public final fun getSchema ()Lcom/apollographql/apollo3/ast/Schema;
109-
public final fun getSchemaPackageName ()Ljava/lang/String;
110-
}
111-
112-
public final class com/apollographql/apollo3/compiler/IncomingOptions$Companion {
113-
public final fun resolveSchema (Ljava/util/Collection;)Lkotlin/Pair;
114-
}
115-
116104
public final class com/apollographql/apollo3/compiler/JavaCodegenOptions {
117105
public fun <init> (ZLjava/util/List;ZLcom/apollographql/apollo3/compiler/JavaNullable;Lcom/apollographql/apollo3/compiler/hooks/ApolloCompilerJavaHooks;)V
118106
public final fun getClassesForEnumsMatching ()Ljava/util/List;

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ object ApolloCompiler {
5858
it.toSchemaGQLDocument()
5959
}
6060

61+
if (schemaDocuments.isEmpty()) {
62+
error("No schema found. Apollo needs a `.graphqls` or a `.json` schema.")
63+
}
64+
6165
// Locate the mainSchemaDocument. It's the one that contains the operation roots
6266
val mainSchemaDocuments = schemaDocuments.filter {
6367
it.definitions.filterIsInstance<GQLSchemaDefinition>().isNotEmpty()

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/IncomingOptions.kt

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)