Class EnvironmentUtils

java.lang.Object
io.jmix.graphql.datafetcher.EnvironmentUtils

@Component("gql_EnvironmentUtils") public class EnvironmentUtils extends Object
  • Constructor Details

    • EnvironmentUtils

      public EnvironmentUtils()
  • Method Details

    • hasInstanceNameProperty

      public boolean hasInstanceNameProperty(graphql.schema.DataFetchingEnvironment environment)
      Parameters:
      environment - gql data fetch environment
      Returns:
      true if _instanceName should be returned for query, else false
    • hasInstanceNameProperty

      public boolean hasInstanceNameProperty(Set<String> props)
      Parameters:
      props - gql data fetch properties
      Returns:
      true if _instanceName should be returned for query, else false
    • getDotDelimitedProps

      public Set<String> getDotDelimitedProps(graphql.schema.DataFetchingEnvironment environment)
    • getEntityProperties

      public List<String> getEntityProperties(graphql.schema.DataFetchingEnvironment environment)
      Filter out system properties such _instanceName or --typeName that not exist as entity fields. Such properties must not be added in fetch plan.
      Parameters:
      environment - gql data fetch environment
      Returns:
      only properties that exist in entity as fields
    • propertyNotMatch

      public Predicate<String> propertyNotMatch(String property)
      Parameters:
      property - property to check
      Returns:
      true if property NOT match 'someProperty' and '*.someProperty'
    • getNestedProps

      public Set<String> getNestedProps(Set<String> props, String propName)
    • getPropertyPaths

      public Stream<String> getPropertyPaths(graphql.schema.DataFetchingEnvironment environment)
    • getPaths

      public List<String> getPaths(graphql.schema.DataFetchingFieldSelectionSet selectionSet, String currentPath)
    • getRemoteIPAddress

      @Nullable public static String getRemoteIPAddress(Object context)
    • findMetaClassByOutTypeName

      protected MetaClass findMetaClassByOutTypeName(String outTypeName)