![]() The fundamental reusable unit of GraphQL. Fragment įragment is an overloaded term, and has at least two distinct meanings in Relay. The GraphQL schema comprises many fields. For example, viewer, comment_create(input: $CommentCreateData) and name are all fields. (Some methods do not accept all fetch policies.) Field īasically, anything you can select using a query, mutation, subscription or fragment. Either network-only, store-and-network, store-or-network or store-only. Fetch Policy Ī string that determines in what circumstances to make a network request in which circumstances to fulfill the query using data in the store, if available. Execute Įxecuting a query, mutation or subscription (collectively, an operation) roughly means "create a lazy observable that, when subscribed to, will make a network request fulfilling the operation and write the returned data to the store."Ī variety of execute methods are exposed on the Relay environment. Set using a RelayEnvironmentProvider and passed down through React context.Īll non-internal Relay hooks require being called within a Relay environment context. Also, includes a publish queue, operation loader, scheduler and missing fields handlers. Environment Īn object bringing together many other Relay objects, most importantly a store and a network. See also preloadable concrete request and JSResource. Entrypoint Ī lightweight object containing information on the components which need to be loaded (as in the form of calls to JSResource) and which queries need to be loaded (in the form of preloadable concrete requests) before a particular route, popover or other piece of conditionally loaded UI can be rendered.Īll queries which are required for the initial rendering of a piece of UI should be included in that UI's entrypoint.Įntrypoints can contain queries and other entrypoints. Many objects in Relay (such query references and entrypoint references) and the return value of many methods (such as calls to. dispose method which takes no parameters and provides no return value. Examples include and Disposable Īny object which contains a. ![]() Directive Ī special instruction, starting with and contained in a graphql literal or graphql file, which provides special instructions to the relay compiler or to the server. Relay requires that GraphQL literals in JavaScript files contain a single definition. In the compiler, a Document refers to a GraphQL literal that contains one or more operation or fragment definitions. Helpful for answering questions like "Why am I not seeing the data I expect to see?" "Why did this component suspend?" etc. DevTools Īn awesome Chrome extension for debugging Relay network requests, the Relay store and Relay events. Descriptors are types used internally to the Relay codebase, and generally, refer to an object containing the minimum amount of information needed to uniquely identify an operation or request, such as (for a RequestIdentifier), a node, identifier and variables. Descriptor Ĭan refer to an OperationDescriptor or RequestDescriptor. In the compiler, a definition refers to the text within a GraphQL literal where an operation or fragment was defined. on User will not be able to access the data declared by subcomponent_viewer_name without access to the ReaderFragment representing the subcomponent_viewer_name fragment.Ī directive which can be added to a fragment spread or inline fragment to avoid blocking on that fragment's data. If type refinement is a way of conditionally including fields if a type implements a particular concrete type (such as. GraphQL unions and interfaces are abstract types. Component can have different rendering strategies, depending on the data.On a given feed, it is likely that most variants will not be rendered, and need not be downloaded. ![]() Which one we render depends on the data (i.e. For example, the core news feed item has many different variants, each of which is a separate React component. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |