Skip to content

Exposing my graphql enum into schema #734

Open

Description

@drmax24
<?php

declare(strict_types=1);

namespace Admin\Presentation\GraphQL\Type;

use Admin\Presentation\GraphQL\Type\ChatTypeFiltersEnum;

#[Type]
enum CommunityChatTypeFilterEnum: string {
    case DIRECT = ChatTypeFiltersEnum::DIRECT->value;
    case GROUP = ChatTypeFiltersEnum::GROUP->value;
    case PUBLIC_CITY = ChatTypeFiltersEnum::PUBLIC_CITY->value;
    case PUBLIC_HOTEL = ChatTypeFiltersEnum::PUBLIC_HOTEL->value;
};

I have this enum. Can I include it into graphql schema without inserting it into query or mutation.
If I insert it into query or mutation the enum appears in the schema.
But if I don't insert it into query or mutation schema does not have this enum...

I need it for code generation on the front end

Activity

  1. oojacoboo commented on Mar 7, 2025

    @oojacoboo
    Collaborator

    I thought all types in the namespace were included in the schema, regardless of whether they are included in an operation. But I haven't confirmed that.

  2. oojacoboo commented on Apr 19, 2026

    @oojacoboo
    Collaborator

    @drmax24 is this still an issue, or can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions