GraphQL Filter

Library to let the user filter through the results of a GraphQL query

Лицензия

Лицензия

Категории

Категории

Java Языки программирования
Группа

Группа

com.github.aoudiamoncef
Идентификатор

Идентификатор

graphql-java-filter
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

GraphQL Filter
Library to let the user filter through the results of a GraphQL query
Ссылка на сайт

Ссылка на сайт

https://github.com/aoudiamoncef/graphql-java-filter
Организация-разработчик

Организация-разработчик

Gentics Software
Система контроля версий

Система контроля версий

https://github.com/aoudiamoncef/graphql-java-filter

Скачать graphql-java-filter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.aoudiamoncef/graphql-java-filter/ -->
<dependency>
    <groupId>com.github.aoudiamoncef</groupId>
    <artifactId>graphql-java-filter</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.aoudiamoncef/graphql-java-filter/
implementation 'com.github.aoudiamoncef:graphql-java-filter:1.2.0'
// https://jarcasting.com/artifacts/com.github.aoudiamoncef/graphql-java-filter/
implementation ("com.github.aoudiamoncef:graphql-java-filter:1.2.0")
'com.github.aoudiamoncef:graphql-java-filter:jar:1.2.0'
<dependency org="com.github.aoudiamoncef" name="graphql-java-filter" rev="1.2.0">
  <artifact name="graphql-java-filter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.aoudiamoncef', module='graphql-java-filter', version='1.2.0')
)
libraryDependencies += "com.github.aoudiamoncef" % "graphql-java-filter" % "1.2.0"
[com.github.aoudiamoncef/graphql-java-filter "1.2.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.graphql-java : graphql-java jar 15.0
commons-io : commons-io jar 2.7

test (4)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-engine jar 5.6.2
org.assertj : assertj-core jar 3.16.1
org.slf4j : slf4j-api jar 1.7.30
org.slf4j : slf4j-simple jar 1.7.30

Модули Проекта

Данный проект не имеет модулей.

GraphQL Filter

CircleCI Download Codacy Badge Known Vulnerabilities FOSSA Status License

Enhance your GraphQL API with filters.

Use this library to let the user filter through the results of a GraphQL query.

Getting Started

  1. Add Graphql Java filter to your project's dependencies:
   <dependency>
       <groupId>com.github.aoudiamoncef</groupId>
       <artifactId>graphql-java-filter</artifactId>
       <version>1.2.0</version>
   </dependency>

Live Demo

Here is an implementation of this library.

Try this query:

{
  nodes(filter: {
    schema: { is: vehicle },
    fields: {
      vehicle: {
        price: {
          lt: 2000000
        }
      }
    }
  }) {
    elements {
      fields {
        ... on vehicle {
          name
          price
        }
      }
    }
  }
}

Play around with the autocompletion to see whats possible.

Usage

Create your filter by implementing the Filter interface or by extending one of the predefined abstract filters. It is best to create your filter by composing the small predefined filters.

See AbstractFilterTest.java to see an example of how to integrate this library in your environment.

Overview

Interfaces

  • Filter The main Filter interface. Every filter implements this.
  • FilterField can be used to create filters that can easily be nested in other filters.
  • StartFilter is used to easily create the argument object for graphql-java

Helper filters

  • MainFilter A filter that does not filter directly and instead contains a collection of other filters.
  • StartMainFilter Same as above but additionally implements StartFilter.
  • MappedFilter Used to map a type into another type using another Filter
  • CommonFilters Provides common filters which can be used for all types. This includes these logical operations of filters: and, or and not.

Predefined filters

The following filters can be used to filter primitive types: BooleanFilter, DateFilter, NumberFilter, StringFilter.

Examples

See NodeFilter.java as an example filter implementation.

Версии библиотеки

Версия
1.2.0
1.1.1