This is an automated email from the ASF dual-hosted git repository. shuber pushed a commit to branch UNOMI-180-CXS-GRAPHQLAPI in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 126f611c0b868f04108287c15b40ae89716927c4 Author: Serge Huber <shu...@apache.org> AuthorDate: Fri Jun 8 11:11:51 2018 +0200 UNOMI-180 Implement CXS GraphQL API - Add some example operators for String filters - Add the possibility to provide a "or" operator as a default for property matching using a seperate "properties_or" field Signed-off-by: Serge Huber <shu...@apache.org> --- .../unomi/graphql/internal/CXSGraphQLProviderImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/internal/CXSGraphQLProviderImpl.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/internal/CXSGraphQLProviderImpl.java index 2c7a0b4..a0596cc 100644 --- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/internal/CXSGraphQLProviderImpl.java +++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/internal/CXSGraphQLProviderImpl.java @@ -189,6 +189,14 @@ public class CXSGraphQLProviderImpl implements CXSGraphQLProvider, GraphQLQueryP .name(propertyName + "_regexp") .type(GraphQLString) ); + inputTypeBuilder.field(newInputObjectField() + .name(propertyName + "_startsWith") + .type(GraphQLString) + ); + inputTypeBuilder.field(newInputObjectField() + .name(propertyName + "_contains") + .type(new GraphQLList(GraphQLString)) + ); } private void addBooleanFilters(String propertyName, GraphQLInputObjectType.Builder inputTypeBuilder) { @@ -275,6 +283,10 @@ public class CXSGraphQLProviderImpl implements CXSGraphQLProvider, GraphQLQueryP .type(registeredInputTypes.get("CXS_EventPropertiesFilterInput")) ) .field(newInputObjectField() + .name("properties_or") + .type(registeredInputTypes.get("CXS_EventPropertiesFilterInput")) + ) + .field(newInputObjectField() .name("eventOccurrence") .type(registeredInputTypes.get(CXSEventOccurrenceFilterInput.class.getName())) );