跳转到主要内容

EnvironmentKey

An EnvironmentKey is class that can be used to match up a Relay Environment registered with <RecoilRelayEnvironment> in your <RecoilRoot> with a GraphQL selector or atom effect that uses it to query.

const myEnvironmentKey = new EnvironmentKey('My Environment');

Using an EnvironmentKey to register Relay Environments instead of just specifying the Relay Environment direclty in the query can be useful if the environment is only known at render time.