I'm using hasura to expose my graphql API.
The generated schema looks like this ( some lines removed for clarity, full version here)
User has a one to many relationship with book.
schema {
query: query_root
mutation: mutation_root
subscription: subscription_root
}
# columns and relationships of "book"
type book {
# An object relationship
author: user
authorName: String
title: String!
}
# columns and relationships of "user"
type user {
# An array relationship
books(
# distinct select on columns
distinct_on: [book_select_column!]
# limit the nuber of rows returned
limit: Int
# skip the first n rows. Use only with order_by
offset: Int
# sort the rows by one or more columns
order_by: [book_order_by!]
# filter the rows returned
where: book_bool_exp
): [book!]!
name: String!
}
# input type for inserting data into table "user"
input user_insert_input {
books: book_arr_rel_insert_input
name: String
}
# input type for inserting data into table "book"
input book_insert_input {
author: user_obj_rel_insert_input
authorName: String
title: String
}
# input type for inserting array relation for remote table "book"
input book_arr_rel_insert_input {
data: [book_insert_input!]!
on_conflict: book_on_conflict
}
# input type for inserting object relation for remote table "user"
input user_obj_rel_insert_input {
data: user_insert_input!
on_conflict: user_on_conflict
}
The parser fails to load this schema
Exception in thread "main" java.lang.StackOverflowError
at java.base/java.util.LinkedHashSet.<init>(LinkedHashSet.java:168)
at kotlin.collections.CollectionsKt___CollectionsKt.toMutableSet(_Collections.kt:1450)
at kotlin.collections.CollectionsKt___CollectionsKt.subtract(_Collections.kt:1438)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedTypes(GraphQLDocumentParser.kt:542)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedTypes(GraphQLDocumentParser.kt:544)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedTypes(GraphQLDocumentParser.kt:544)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedTypes(GraphQLDocumentParser.kt:544)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedSchemaTypes(GraphQLDocumentParser.kt:534)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedSchemaTypes(GraphQLDocumentParser.kt:536)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedSchemaTypes(GraphQLDocumentParser.kt:536)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedSchemaTypes(GraphQLDocumentParser.kt:536)
at com.apollographql.apollo.compiler.parser.GraphQLDocumentParser.usedSchemaTypes(GraphQLDocumentParser.kt:536)
...
I'm using hasura to expose my graphql API. The generated schema looks like this ( some lines removed for clarity, full version here)
User has a one to many relationship with book.
The parser fails to load this schema