Skip to content

Instantly share code, notes, and snippets.

@nikolal
Last active November 22, 2016 12:53
Show Gist options
  • Save nikolal/264cbb62cb8b85f2dbcce45d9e4e6449 to your computer and use it in GitHub Desktop.
Save nikolal/264cbb62cb8b85f2dbcce45d9e4e6449 to your computer and use it in GitHub Desktop.
// working example
export class NewActivityRoute extends Relay.Route {
static routeName = 'NewActivityRoute';
static queries = {
all_sports: Component => Relay.QL`
query {
viewer {
${Component.getFragment('all_sports')}
}
}
`
};
}
export default Relay.createContainer(NewActivityPage, {
fragments: {
all_sports: () => Relay.QL`
fragment on Viewer{
sports (last: 50){
edges {
node {
id,
name {
FR,
EN,
DE,
ES
},
logo
}
}
}
}
`
}
});
@nodkz
Copy link

nodkz commented Nov 22, 2016

import Component from '...';

export class NewActivityRoute extends Relay.Route {
  static routeName = 'NewActivityRoute';
  static queries = {
    all_sports: () => Relay.QL`   //  <------------------ error here
      query {
        viewer {
          ${Component.getFragment('all_sports')}
        }
      }
    `
  };
}

@nikolal
Copy link
Author

nikolal commented Nov 22, 2016

This one is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment