-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore | adding context options to explore query (#194)
* chore | adding context options to explore query
- Loading branch information
1 parent
dc8d1d5
commit bef2cec
Showing
10 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
Submodule hypertrace-core-graphql
updated
1 files
+1 −1 | hypertrace-core-graphql-platform/build.gradle.kts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ypertrace/graphql/explorer/deserialization/EntityContextOptionsDeserializationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.hypertrace.graphql.explorer.deserialization; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.Module; | ||
import com.fasterxml.jackson.databind.module.SimpleModule; | ||
import java.util.List; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
import lombok.experimental.Accessors; | ||
import org.hypertrace.core.graphql.deserialization.ArgumentDeserializationConfig; | ||
import org.hypertrace.graphql.explorer.schema.argument.EntityContextOptions; | ||
|
||
public class EntityContextOptionsDeserializationConfig implements ArgumentDeserializationConfig { | ||
|
||
@Override | ||
public String getArgumentKey() { | ||
return EntityContextOptions.ARGUMENT_NAME; | ||
} | ||
|
||
@Override | ||
public Class<EntityContextOptions> getArgumentSchema() { | ||
return EntityContextOptions.class; | ||
} | ||
|
||
@Override | ||
public List<Module> jacksonModules() { | ||
return List.of( | ||
new SimpleModule() | ||
.addAbstractTypeMapping( | ||
EntityContextOptions.class, | ||
EntityContextOptionsDeserializationConfig.DefaultEntityContextOptionsArgument | ||
.class)); | ||
} | ||
|
||
@Value | ||
@Accessors(fluent = true) | ||
@NoArgsConstructor(force = true) | ||
private static class DefaultEntityContextOptionsArgument implements EntityContextOptions { | ||
|
||
@JsonProperty(EntityContextOptions.INCLUDE_NON_LIVE_ENTITIES) | ||
boolean includeNonLiveEntities; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...a/src/main/java/org/hypertrace/graphql/explorer/schema/argument/EntityContextOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.hypertrace.graphql.explorer.schema.argument; | ||
|
||
import graphql.annotations.annotationTypes.GraphQLField; | ||
import graphql.annotations.annotationTypes.GraphQLName; | ||
import graphql.annotations.annotationTypes.GraphQLNonNull; | ||
|
||
@GraphQLName(EntityContextOptions.TYPE_NAME) | ||
public interface EntityContextOptions { | ||
String TYPE_NAME = "EntityContextOptions"; | ||
String ARGUMENT_NAME = "entityContextOptions"; | ||
String INCLUDE_NON_LIVE_ENTITIES = "includeNonLiveEntities"; | ||
|
||
@GraphQLField | ||
@GraphQLNonNull | ||
@GraphQLName(INCLUDE_NON_LIVE_ENTITIES) | ||
boolean includeNonLiveEntities(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters