relayjs - What do 3 dots/periods/ellipsis in a relay/graphql query mean? -


the relay docs contain fragment:

query rebelsrefetchquery {   node(id: "rmfjdglvbjox") {     id     ... on faction {       name     }   } } 

what ... on faction on syntax mean?

there 2 uses of ... related fragments.

incorporating fragment reference

query foo {   user(id: 4) {     ...userfields   } }  fragment userfields on user {   name } 

has effect of composing fields fragment embedding query:

query foo {   user(id: 4) {     name   } } 

note fragments may compose other fragments.

inline fragments

these can used compose fields in type-dependent way. example:

query foo {   profile(id: $id) {     url     ... on user {       homeaddress     }     ... on business {       address     }   } } 

in example, server determine whether return homeaddress or address field @ runtime, based on whether requested object user or business.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -