Package

sri.relay

query

Permalink

package query

Visibility
  1. Public
  2. All

Type Members

  1. trait BatchCall extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  2. trait FragmentMetadata extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  3. class GraphQLBatchCallVariable extends Object

    Permalink

    Represents a GraphQL call variable for use with the GraphQL Batch API.

    Represents a GraphQL call variable for use with the GraphQL Batch API.

    For example, given a source query identified by "q0", we would make a batch call variable "<ref_q0>" as follows:

    new GraphQL.BatchCallVariable('q0', '$.*.actor.id');

    The batch API allows streaming responses to the client, re-using information from previous queries via ref_params; the query identifier ("q0" in the example above) combined with a JSONPath to the node to be extended ("$.*.actor.id") allow us to define a supplementary query that retrieves additional information (example: https://fburl.com/65122329) for that node.

    Annotations
    @RawJSType() @native()
    See also

    https://our.intern.facebook.com/intern/dex/graphql-batch-api

  4. class GraphQLCallValue extends Object

    Permalink

    Represents a value passed to a GraphQL call (for example, the value 5 passed in a call like first(5)).

    Represents a value passed to a GraphQL call (for example, the value 5 passed in a call like first(5)).

    Annotations
    @RawJSType() @native()
  5. class GraphQLCallVariable extends Object

    Permalink

    Represents a variable used in a GraphQL call.

    Represents a variable used in a GraphQL call.

    For example:

    new GraphQL.CallVariable('foo') // variable: <foo>

    Annotations
    @RawJSType() @native()
  6. class GraphQLCallvNode extends Object

    Permalink

    Represents a GraphQL call such as size(50, 50) or (size: 32).

    Represents a GraphQL call such as size(50, 50) or (size: 32).

    Annotations
    @RawJSType() @native()
  7. class GraphQLFieldNode extends Object with GraphQLNode

    Permalink

    Represents a field in a GraphQL query.

    Represents a field in a GraphQL query.

    A field may be simple or arbitrarily complex, including calls, and containing subfields, nested fragments.

    Annotations
    @RawJSType() @native()
  8. class GraphQLMutation extends GraphQLOperation

    Permalink

    Represents a GraphQL mutation.

    Represents a GraphQL mutation.

    Annotations
    @RawJSType() @native()
  9. trait GraphQLNode extends Object

    Permalink

    Represents a GraphQL node.

    Represents a GraphQL node.

    A node may contain zero or more fields and/or query fragments.

    Note that we don't actually export this class (rather, we export subclasses corresponding to fields, fragments, queries and mutations); we do, however, use GraphQLNode as a type throughout Dlite.

    Annotations
    @RawJSType() @native()
  10. class GraphQLOperation extends Object with GraphQLNode

    Permalink

    Base class from which GraphQLMutation and GraphQLSubscription extend.

    Base class from which GraphQLMutation and GraphQLSubscription extend.

    Annotations
    @RawJSType() @native()
  11. class GraphQLQuery extends Object with GraphQLNode

    Permalink

    Represents a root GraphQL query such as viewer() { ... } or me() { ... }.

    Represents a root GraphQL query such as viewer() { ... } or me() { ... }.

    Queries may contain zero or more fields, and/or subfragments.

    Annotations
    @RawJSType() @native()
  12. class GraphQLQueryFragment extends Object with GraphQLNode

    Permalink

    Represents a query fragment in a GraphQL query.

    Represents a query fragment in a GraphQL query.

    A fragment may contain zero or more fields and/or additional fragments.

    Annotations
    @RawJSType() @native()
  13. class GraphQLQueryWithValues extends Object

    Permalink

    Comprises a GraphQL query (see GraphQLQuery) and a set of values.

    Comprises a GraphQL query (see GraphQLQuery) and a set of values.

    In practice, we're don't currently make use of the values anywhere in Dlite, but we use GraphQLQueryWithValues widely within Dlite as a type.

    Annotations
    @RawJSType() @native()
  14. class GraphQLSubscription extends GraphQLOperation

    Permalink

    Represents a GraphQL subscription.

    Represents a GraphQL subscription.

    Annotations
    @RawJSType() @native()
  15. class RelayFragmentReference extends Object

    Permalink

    internal

    internal

    RelayFragmentReference is the return type of fragment composition:

    fragment on Foo { ${Child.getFragment('bar', {baz: variables.qux})} }

    Whereas a fragment defines a sub-query's structure, a fragment reference is a particular instantiation of the fragment as it is composed within a query or another fragment. It encodes the source fragment, initial variables, and a mapping from variables in the composing query's (or fragment's) scope to variables in the fragment's scope.

    The variable mapping is represented by variableMapping, a dictionary that maps from names of variables in the parent scope to variables that exist in the fragment. Example:

    // Fragment: var Container = Relay.createContainer(..., { initialVariables: { private: 'foo', public: 'bar', variable: null, }, fragments: { foo: ... } });

    // Reference: ${Container.getQuery( 'foo', // Variable Mapping: { public: 'BAR', variable: variables.source, } )}

    When evaluating the referenced fragment, $public will be overridden with 'Bar'. The value of $variable will become the value of $source in the outer scope. This is analagous to:

    function inner(private = 'foo', public = 'bar', variable) {} function outer(source) { inner(public = 'BAR', variable = source); }

    Where the value of the inner variable depends on how outer is called.

    The prepareVariables function allows for variables to be modified based on the runtime environment or route name.

    Annotations
    @RawJSType() @native()
  16. class RelayQueryField extends Object with RelayQueryNode

    Permalink

    internal

    internal

    Wraps access to query fields.

    Note: place proxy methods for GraphQL.Field here.

    Annotations
    @RawJSType() @native()
  17. class RelayQueryFragment extends Object with RelayQueryNode

    Permalink

    internal

    internal

    Wraps access to query fragments.

    Note: place proxy methods for GraphQL.QueryFragment here.

    Annotations
    @RawJSType() @native()
  18. trait RelayQueryMutation extends RelayQueryOperation

    Permalink

    internal

    internal

    Represents a GraphQL mutation.

    Annotations
    @RawJSType() @native()
  19. trait RelayQueryNode extends Object

    Permalink

    internal

    internal

    Queries in Relay are represented as trees. Possible nodes include the root, fields, and fragments. Fields can have children, or they can be leaf nodes. Root and fragment nodes must always have children.

    RelayQueryNode provides access to information such as the field name, generated alias, sub-fields, and call values.

    Nodes are immutable; query modification is supported via clone:

    var next = prev.clone(prev.getChildren().filter(f => ...));

    Note: Mediating access to actual query nodes is necessary so that we can replace the current mutable GraphQL nodes with an immutable query representation. This class *must not* mutate the underlying concreteNode. Instead, use an instance variable (see clone()).

    TODO (#6937314): RelayQueryNode support for toJSON/fromJSON

    Annotations
    @RawJSType() @native()
  20. class RelayQueryOperation extends Object with RelayQueryNode

    Permalink
    Annotations
    @RawJSType() @native()
  21. class RelayQueryRoot extends Object with RelayQueryNode

    Permalink
    Annotations
    @RawJSType() @native()
  22. trait RelayQuerySubscription extends RelayQueryOperation

    Permalink

    internal

    internal

    Represents a GraphQL subscription.

    Annotations
    @RawJSType() @native()

Value Members

  1. object GraphQLBatchCallVariable extends Object

    Permalink
    Annotations
    @native()
  2. object GraphQLCallValue extends Object

    Permalink
    Annotations
    @native()
  3. object GraphQLCallVariable extends Object

    Permalink
    Annotations
    @native()
  4. object GraphQLCallvNode extends Object

    Permalink
    Annotations
    @native()
  5. object GraphQLFieldNode extends Object

    Permalink
    Annotations
    @native()
  6. object GraphQLMutation extends Object

    Permalink
    Annotations
    @native()
  7. object GraphQLOperation extends Object

    Permalink
    Annotations
    @native()
  8. object GraphQLQuery extends Object

    Permalink
    Annotations
    @native()
  9. object GraphQLQueryFragment extends Object

    Permalink
    Annotations
    @native()
  10. object GraphQLSubscription extends Object

    Permalink
    Annotations
    @native()
  11. object RelayFragmentReference

    Permalink
  12. object RelayQL

    Permalink
  13. object RelayQuery extends Object

    Permalink
    Annotations
    @native()

Ungrouped