overblog / GraphQLBundle

This bundle provides tools to build a complete GraphQL API server in your Symfony App.
MIT License
783 stars 221 forks source link

Could not find type with alias "Subscription". Did you forget to define it? #1129

Closed chou666 closed 1 year ago

chou666 commented 1 year ago
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Version/Branch 1.0.0

I try to update from 0.15.1 to 1.0.0 (Symfony 5.4.27) with config:

overblog_graphql:
    definitions:
        config_validation: true
        schema:
            query: Query
            mutation: Mutation
            types:
              - <a lot>

When I clear the cache, I have the following error:

Could not find type with alias "Subscription". Did you forget to define it?

This error is not present with 0.15.1. An idea ? I see subscription experimental feature, is there a way to disable it ? Maybe a missing configuration ?

mcg-web commented 1 year ago

Have you got any type named Subscription in your query or mutation schema definition? Can you try adding Subscription to definitions.schema.types ?

chou666 commented 1 year ago

@mcg-web thanks for the answer.

I define the Subscription type as:

Subscription:
    type: object
    config:
        fields:
            id:
                type: ID!

And no more error. Thanks for your help !