Skip to content

GraphQL: Merge the label-application-rules-schema into the labels-schema #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hypertrace-graphql-impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies {
implementation(project(":hypertrace-graphql-entity-type"))
implementation(project(":hypertrace-graphql-spaces-schema"))
implementation(project(":hypertrace-graphql-labels-schema-impl"))
implementation(project(":hypertrace-graphql-label-application-rules-schema"))

implementation("org.slf4j:slf4j-api")
implementation("com.google.inject:guice")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.hypertrace.graphql.explorer.ExplorerSchemaModule;
import org.hypertrace.graphql.explorer.context.HypertraceExplorerContextModule;
import org.hypertrace.graphql.label.LabelSchemaModule;
import org.hypertrace.graphql.label.application.rules.LabelApplicationRuleSchemaModule;
import org.hypertrace.graphql.metric.MetricModule;
import org.hypertrace.graphql.spaces.SpacesSchemaModule;
import org.hypertrace.graphql.utils.metrics.gateway.GatewayMetricUtilsModule;
Expand Down Expand Up @@ -74,6 +73,5 @@ protected void configure() {
install(new SpacesSchemaModule());
install(new RequestTransformationModule());
install(new LabelSchemaModule());
install(new LabelApplicationRuleSchemaModule());
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions hypertrace-graphql-labels-schema-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dependencies {

annotationProcessor("org.projectlombok:lombok")
compileOnly("org.projectlombok:lombok")

implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-deserialization")
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.hypertrace.graphql.label.application.rules.dao;
package org.hypertrace.graphql.label.dao;

import io.reactivex.rxjava3.core.Single;
import org.hypertrace.core.graphql.common.request.ContextualRequest;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleCreateRequest;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleDeleteRequest;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleUpdateRequest;
import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet;
import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule;
import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest;
import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest;
import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet;

public interface LabelApplicationRuleDao {
Single<LabelApplicationRule> createLabelApplicationRule(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.deserialization;
package org.hypertrace.graphql.label.deserialization;

import org.hypertrace.core.graphql.deserialization.PrimitiveArgument;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hypertrace.graphql.label.application.rules.fetcher;
package org.hypertrace.graphql.label.fetcher;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher;
import org.hypertrace.core.graphql.common.request.ContextualRequestBuilder;
import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet;
import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet;

public class LabelApplicationRuleFetcher
extends InjectableDataFetcher<LabelApplicationRuleResultSet> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hypertrace.graphql.label.application.rules.mutator;
package org.hypertrace.graphql.label.mutator;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher;
import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder;
import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule;
import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule;

public class LabelApplicationRuleCreateMutator extends InjectableDataFetcher<LabelApplicationRule> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.hypertrace.graphql.label.application.rules.mutator;
package org.hypertrace.graphql.label.mutator;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher;
import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder;
import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder;

public class LabelApplicationRuleDeleteMutator extends InjectableDataFetcher<Boolean> {
public LabelApplicationRuleDeleteMutator() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hypertrace.graphql.label.application.rules.mutator;
package org.hypertrace.graphql.label.mutator;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher;
import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder;
import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule;
import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao;
import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule;

public class LabelApplicationRuleUpdateMutator extends InjectableDataFetcher<LabelApplicationRule> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hypertrace.graphql.label.application.rules.request;
package org.hypertrace.graphql.label.request;

import org.hypertrace.core.graphql.common.request.ContextualRequest;
import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData;

public interface LabelApplicationRuleCreateRequest extends ContextualRequest {
LabelApplicationRuleData labelApplicationRuleData();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.request;
package org.hypertrace.graphql.label.request;

import org.hypertrace.core.graphql.common.request.ContextualRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.request;
package org.hypertrace.graphql.label.request;

import java.util.Map;
import org.hypertrace.core.graphql.context.GraphQlRequestContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hypertrace.graphql.label.application.rules.request;
package org.hypertrace.graphql.label.request;

import org.hypertrace.core.graphql.common.request.ContextualRequest;
import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule;

public interface LabelApplicationRuleUpdateRequest extends ContextualRequest {
LabelApplicationRule labelApplicationRule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
import graphql.annotations.annotationTypes.GraphQLField;
import graphql.annotations.annotationTypes.GraphQLName;
import graphql.annotations.annotationTypes.GraphQLNonNull;
import org.hypertrace.graphql.label.fetcher.LabelApplicationRuleFetcher;
import org.hypertrace.graphql.label.fetcher.LabelFetcher;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet;

public interface LabelSchema {
String LABELS_QUERY_NAME = "labels";
String LABEL_APPLICATION_RULE_QUERY_NAME = "labelApplicationRules";

@GraphQLField
@GraphQLNonNull
@GraphQLName(LABELS_QUERY_NAME)
@GraphQLDataFetcher(LabelFetcher.class)
LabelResultSet labels();

@GraphQLField
@GraphQLNonNull
@GraphQLName(LABEL_APPLICATION_RULE_QUERY_NAME)
@GraphQLDataFetcher(LabelApplicationRuleFetcher.class)
LabelApplicationRuleResultSet labelApplicationRules();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@
import graphql.annotations.annotationTypes.GraphQLField;
import graphql.annotations.annotationTypes.GraphQLName;
import graphql.annotations.annotationTypes.GraphQLNonNull;
import org.hypertrace.graphql.label.deserialization.LabelApplicationRuleIdArgument;
import org.hypertrace.graphql.label.mutator.LabelApplicationRuleCreateMutator;
import org.hypertrace.graphql.label.mutator.LabelApplicationRuleDeleteMutator;
import org.hypertrace.graphql.label.mutator.LabelApplicationRuleUpdateMutator;
import org.hypertrace.graphql.label.mutator.LabelCreateMutator;
import org.hypertrace.graphql.label.mutator.LabelUpdateMutator;
import org.hypertrace.graphql.label.schema.Label;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule;
import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData;

public interface LabelMutationSchema {
String CREATE_LABEL = "createLabel";
String UPDATE_LABEL = "updateLabel";
String CREATE_LABEL_APPLICATION_RULE = "createLabelApplicationRule";
String UPDATE_LABEL_APPLICATION_RULE = "updateLabelApplicationRule";
String DELETE_LABEL_APPLICATION_RULE = "deleteLabelApplicationRule";

@GraphQLField
@GraphQLNonNull
Expand All @@ -23,4 +32,27 @@ public interface LabelMutationSchema {
@GraphQLName(UPDATE_LABEL)
@GraphQLDataFetcher(LabelUpdateMutator.class)
Label updateLabel(@GraphQLNonNull @GraphQLName(Label.ARGUMENT_NAME) UpdateLabel label);

@GraphQLField
@GraphQLNonNull
@GraphQLName(CREATE_LABEL_APPLICATION_RULE)
@GraphQLDataFetcher(LabelApplicationRuleCreateMutator.class)
LabelApplicationRule createLabelApplicationRule(
@GraphQLNonNull @GraphQLName(LabelApplicationRuleData.ARGUMENT_NAME)
LabelApplicationRuleData labelApplicationRuleData);

@GraphQLField
@GraphQLNonNull
@GraphQLName(UPDATE_LABEL_APPLICATION_RULE)
@GraphQLDataFetcher(LabelApplicationRuleUpdateMutator.class)
LabelApplicationRule updateLabelApplicationRule(
@GraphQLNonNull @GraphQLName(LabelApplicationRule.ARGUMENT_NAME)
LabelApplicationRule labelApplicationRule);

@GraphQLField
@GraphQLNonNull
@GraphQLName(DELETE_LABEL_APPLICATION_RULE)
@GraphQLDataFetcher(LabelApplicationRuleDeleteMutator.class)
Boolean deleteLabelApplicationRule(
@GraphQLNonNull @GraphQLName(LabelApplicationRuleIdArgument.ARGUMENT_NAME) String id);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.schema.shared;
package org.hypertrace.graphql.label.schema.rule;

import graphql.annotations.annotationTypes.GraphQLField;
import graphql.annotations.annotationTypes.GraphQLName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.schema.shared;
package org.hypertrace.graphql.label.schema.rule;

import graphql.annotations.annotationTypes.GraphQLField;
import graphql.annotations.annotationTypes.GraphQLName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hypertrace.graphql.label.application.rules.schema.shared;
package org.hypertrace.graphql.label.schema.rule;

import graphql.annotations.annotationTypes.GraphQLField;
import graphql.annotations.annotationTypes.GraphQLName;
Expand Down
Loading