-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RelaySelector helper class, start of updated Environment interface
Summary: Defines the `Selector` interface and implements helpers for converting fragment props into Selectors. This is a building block for implementing `FragmentSpecResolver` that will be the foundation of the new container APIs. As part of making the test work I had to fix an issue with `BabelPluginGraphQL`. It outputs a root fragment for a query, but this conflicted because the test schema uses the name "Root" for the query type instead of the defacto standard "Query". This then necessitated a fix to our validation of the `node` field, which needed to check that the `node` field was not on the query type. Reviewed By: wincent Differential Revision: D4309955 fbshipit-source-id: e97c767dcb37974d3359165f011ff0fe63f87304
- Loading branch information
1 parent
44b24f3
commit 73c100b
Showing
12 changed files
with
1,031 additions
and
7 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
rmZo763xq6oGqjdkqeGl1CqgLvU= | ||
SzFLdHGEENZur/dboJUZxgpY5zU= |
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
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,45 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule RelayEnvironmentTypes | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import type { | ||
ConcreteFragmentDefinition, | ||
} from 'ConcreteQuery'; | ||
import type {DataID} from 'RelayInternalTypes'; | ||
import type RelayQuery from 'RelayQuery'; | ||
import type {Variables} from 'RelayTypes'; | ||
|
||
/** | ||
* A selector defines the starting point for a traversal into the graph for the | ||
* purposes of targeting a subgraph. | ||
*/ | ||
export type Selector = { | ||
dataID: DataID, | ||
node: ConcreteFragmentDefinition, | ||
variables: Variables, | ||
}; | ||
|
||
/** | ||
* An operation selector describes a specific instance of a GraphQL operation | ||
* with variables applied. | ||
* | ||
* - `fragment`: a selector intended for use in reading or subscribing to | ||
* the results of the the operation. | ||
* - `queries`: an object of queries that can be used to fetch the data for this | ||
* operation. | ||
*/ | ||
export type OperationSelector = { | ||
fragment: Selector, | ||
queries: Array<RelayQuery.Root>, | ||
variables: Variables, | ||
}; |
Oops, something went wrong.