sergehuber commented on a change in pull request #159:
URL: https://github.com/apache/unomi/pull/159#discussion_r429955977



##########
File path: 
graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/providers/sample/CDPProfileExtension.java
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.graphql.providers.sample;

Review comment:
       Maybe we should put these files in a separate sub-project ? 

##########
File path: 
graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/types/output/CDPPageInfo.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.graphql.types.output;
+
+import graphql.annotations.annotationTypes.GraphQLField;
+import graphql.annotations.annotationTypes.GraphQLName;
+
+@GraphQLName("CDP_PageInfo")

Review comment:
       Not sure about the name. In the spec I think it needs to be called 
PageInfo. See here: https://relay.dev/graphql/connections.htm

##########
File path: 
graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/fetchers/ConnectionParams.java
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.unomi.graphql.fetchers;
+
+import java.util.Date;
+
+public class ConnectionParams {
+    private int first;
+    private int last;
+    private Date after;
+    private Date before;
+
+    private ConnectionParams(final Builder builder) {
+        first = builder.first;
+        last = builder.last;
+        after = builder.after;
+        before = builder.before;
+    }
+
+    public int getFirst() {
+        return first;
+    }
+
+    public int getLast() {
+        return last;
+    }
+
+    public int getSize() {
+        return last - first;

Review comment:
       This is not how this works. first & after are used together OR before 
and last are used together
   
   Basically if you have page = 10, offset=5 this would be : first 10 after 5
   But the cursor concept is more abstract, it can be something else than a 
simple offset
   

##########
File path: 
graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/fetchers/ConnectionParams.java
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.unomi.graphql.fetchers;
+
+import java.util.Date;
+
+public class ConnectionParams {
+    private int first;
+    private int last;
+    private Date after;

Review comment:
       According to the relay connection specs these are just cursors. They can 
be used as offsets too while the first and last are actually similar to page 
sizes
   

##########
File path: 
graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/types/output/property/CDPSetPropertyType.java
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.graphql.types.output.property;
+
+import graphql.annotations.annotationTypes.GraphQLField;
+import graphql.annotations.annotationTypes.GraphQLName;
+import org.apache.unomi.api.PropertyType;
+import org.apache.unomi.graphql.types.output.CDPPropertyInterface;
+
+import java.util.List;
+
+import static 
org.apache.unomi.graphql.types.output.property.CDPSetPropertyType.TYPE_NAME;
+
+@GraphQLName(TYPE_NAME)
+public class CDPSetPropertyType extends CDPPropertyType implements 
CDPPropertyInterface {
+
+    public static final String TYPE_NAME = "CDP_SetProperty";
+
+    public static final String UNOMI_TYPE = "set";
+
+    public CDPSetPropertyType(final PropertyType type) {
+        super(type);
+    }
+
+    @GraphQLField
+    public List<CDPPropertyInterface> properties() {
+        //TODO when unomi supports this type

Review comment:
       I thought this was implemented ? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to