Skip to content

Exposing my graphql enum into schema #734

@drmax24

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions