graphql-python / graphql-python/graphene-sqlalchemy
AssertionError: Found different types with the same name in the schema
- Linguagem predominante
- Python
- Estrelas
- 985
- Forks
- 223
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
I have two Classes Products and SalableProducts in my Models (SalableProducts inherits from Products so it has every field of it's database), in my Schema here is what i did
```python
class Product(SQLAlchemyObjectType):
class Meta:
model = ProductModel
interfaces = (relay.Node, )
class ProductConnections(relay.Connection):
class Meta:
node = Product
```
```python
class SalableProduct(SQLAlchemyObjectType):
class Meta:
model = SalableProductModel
interfaces = (relay.Node, )
class SalableProductConnections(relay.Connection):
class Meta:
node = SalableProduct
```
and here is my Query class :
```python
class Query(graphene.ObjectType):
node = relay.Node.Field()
all_products = SQLAlchemyConnectionField(ProductConnections)
all_salable_products = SQLAlchemyConnectionField(SalableProductConnections)
```
When i run my server i got this error :
AssertionError: Found different types with the same name in the schema: product_status, product_status.
Guia de contribuição
Direção de pesquisa
Start with the Product and SalableProduct SQLAlchemyObjectType and connection definitions shown in the issue, then reproduce the server startup error from the Query fields. Trace how the schema creates the product_status types; done means the schema builds without the duplicate-type assertion while preserving both product queries.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python, sqlalchemy
- Domínio
- api, backend-api-design
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100