Skip to content

How can I modify an existing field? #1981

Answered by simplenotezy
simplenotezy asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm - it was easier than I thought:

        register_graphql_field('MediaItem', 'custom', [
            'type' => 'Json',
            'description' => __('Some description'),
            'resolve' => function ($fields) {
                return [
                    'hi'
                ];
            }
        ]);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jasonbahl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant