Skip to content

Commit

Permalink
another fix# Please enter the commit message for your changes. Lines …
Browse files Browse the repository at this point in the history
…starting
  • Loading branch information
rchernobelskiy committed Jun 18, 2020
1 parent e2feeaa commit 51ab49b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphql/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (sg *SchemaGenerator) buildQueriesFields(
}
}

if len(keyspace.Tables) == 0 {
if len(keyspace.Tables) == 0 || len(keyspace.Tables) == len(ksSchema.ignoredTables) {
// graphql-go requires at least a single query and a single mutation
fields["__keyspaceEmptyQuery"] = &graphql.Field{
Description: "Placeholder query that is exposed when a keyspace is empty.",
Expand Down Expand Up @@ -165,7 +165,7 @@ func (sg *SchemaGenerator) buildMutationFields(
}
}

if len(keyspace.Tables) == 0 {
if len(keyspace.Tables) == 0 || len(keyspace.Tables) == len(ksSchema.ignoredTables) {
// graphql-go requires at least a single query and a single mutation
fields["__keyspaceEmptyMutation"] = &graphql.Field{
Description: "Placeholder mutation that is exposed when a keyspace is empty.",
Expand Down

0 comments on commit 51ab49b

Please sign in to comment.