Skip to content

SearchFilter not working with GraphQL ? #2724

Description

@Isengo1989

I am using the SearchFilter Class on kw

<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Annotation\ApiFilter;

/**
 * @ApiResource
 * @ORM\Entity
 */
class Availability
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var int
     * @ApiFilter(SearchFilter::class, strategy="exact")
     * @ORM\Column(name="kw", type="integer", nullable=false)
     */
    public $kw;

It works fine on REST but not on GraphQL, because it is returning the full list

Auswahl_427

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions