How to use the react-relay/classic.createContainer function in react-relay

To help you get started, we’ve selected a few react-relay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buildkite / frontend / app / components / member / Teams / row.js View on Github external
teamMember: this.props.teamMember
    });

    Relay.Store.commitUpdate(mutation, {
      onFailure: (transaction) => {
        // Remove the "removing" spinner
        this.setState({ removing: false });

        // Show the mutation error
        FlashesStore.flash(FlashesStore.ERROR, transaction.getError());
      }
    });
  }
}

export default Relay.createContainer(Row, {
  fragments: {
    teamMember: () => Relay.QL`
      fragment on TeamMember {
        id
        role
        team {
          id
          name
          description
          slug
          privacy
          organization {
            slug
          }
          pipelines {
            count
github buildkite / frontend / app / components / pipeline / schedules / New.js View on Github external
if (error.source && error.source.type === GraphQLErrors.RECORD_VALIDATION_ERROR) {
        this.setState({ errors: transaction.getError().source.errors });
      } else {
        alert(error);
      }
    }

    this.setState({ saving: false });
  };

  handleMutationSuccess = (response) => {
    this.context.router.push(`/${this.props.params.organization}/${this.props.params.pipeline}/settings/schedules/${response.pipelineScheduleCreate.pipelineScheduleEdge.node.uuid}`);
  };
}

export default Relay.createContainer(New, {
  fragments: {
    pipeline: () => Relay.QL`
      fragment on Pipeline {
        name
        ${Form.getFragment('pipeline')}
        ${PipelineScheduleCreateMutation.getFragment('pipeline')}
      }
    `
  }
});
github NCI-GDC / portal-ui / src / Portal.js View on Github external
import Relay from 'react-relay/classic';
import PortalContainer from '@ncigdc/components/PortalContainer';

const PortalQuery = {
  fragments: {
    viewer: () => Relay.QL`
      fragment on Root {
        user {
          username
        }
      }
    `,
  },
};

const Portal = Relay.createContainer(PortalContainer, PortalQuery);

export default Portal;
github meedan / check-web / src / app / components / team / JoinTeam.js View on Github external
import React from 'react';
import Relay from 'react-relay/classic';
import teamPublicFragment from '../../relay/teamPublicFragment';
import PublicTeamRoute from '../../relay/PublicTeamRoute';
import JoinTeamComponent from './JoinTeamComponent';

const JoinTeamContainer = Relay.createContainer(JoinTeamComponent, {
  fragments: {
    team: () => teamPublicFragment,
  },
});

const JoinTeam = (props) => {
  const teamSlug = (props.params && props.params.team) ? props.params.team : '';
  const route = new PublicTeamRoute({ teamSlug });
  return ();
};

export default JoinTeam;
github meedan / check-web / src / app / components / team / Team.js View on Github external
import React from 'react';
import Relay from 'react-relay/classic';
import TeamRoute from '../../relay/TeamRoute';
import TeamComponent from './TeamComponent';
import teamFragment from '../../relay/teamFragment';

const TeamContainer = Relay.createContainer(TeamComponent, {
  initialVariables: {
    pageSize: 20,
  },
  fragments: {
    team: () => teamFragment,
  },
});

const Team = (props) => {
  const slug = props.params.team || '';
  if (slug === '') {
    return null;
  }
  const route = new TeamRoute({ teamSlug: slug });
  return (
github NCI-GDC / portal-ui / src / packages / @ncigdc / components / MostAffectedCasesChart.js View on Github external
hits (first: 20 filters: $macChart_filters, score: $score) @include(if: $fetchData) {
            total
            edges {
              node {
                score
                case_id
              }
            }
          }
        }
      }
    `
  }
};

const MostAffectedCasesChart = Relay.createContainer(
  MostAffectedCasesChartComponent,
  MostAffectedCasesChartQuery
);

export default MostAffectedCasesChart;
github buildkite / frontend / app / components / layout / Footer / index.js View on Github external
Privacy
            Terms
            Support
            System Status
          
          <div>
            <a href="http://twitter.com/buildkite"></a>
            <a href="https://github.com/buildkite"></a>
          </div>
        
      
    );
  }
}

export default Relay.createContainer(Footer, {
  initialVariables: {
    isMounted: false
  },

  fragments: {
    viewer: () =&gt; Relay.QL`
      fragment on Viewer {
        unreadChangelogs: changelogs(read: false) @include(if: $isMounted) {
          count
        }
      }
    `
  }
});
github meedan / check-web / src / app / components / project / ProjectHeader.js View on Github external
{currentProject ? currentProject.title : }
            
          
          : null}
      
    );
  }
}

ProjectHeaderComponent.contextTypes = {
  store: PropTypes.object,
  router: PropTypes.object,
};

const ProjectHeaderContainer = Relay.createContainer(ProjectHeaderComponent, {
  fragments: {
    project: () =&gt; Relay.QL`
      fragment on Project {
        title,
        description
      }
    `,
  },
});

const ProjectHeader = (props) =&gt; {
  if (props.params &amp;&amp; props.params.projectId) {
    const route = new ProjectRoute({ contextId: props.params.projectId });
    return (
github buildkite / frontend / app / components / organization / Pipeline / status.js View on Github external
return (
      
    );
  }

  handleMouseOver = () =&gt; {
    this.setState({ hover: true });
  }

  handleMouseOut = () =&gt; {
    this.setState({ hover: false });
  }
}

export default Relay.createContainer(Status, {
  fragments: {
    pipeline: () =&gt; Relay.QL`
      fragment on Pipeline {
        id
        builds(first: 1, branch: "%default", state: [ RUNNING, CANCELING, PASSED, FAILED, CANCELED, BLOCKED ]) {
          edges {
            node {
              state
              url
              ${BuildTooltip.getFragment('build')}
            }
          }
        }
      }
    `
  }
github buildkite / frontend / app / components / pipeline / schedules / Show / build.js View on Github external
}).isRequired
  };

  render() {
    return (
      
        <div style="{{">
          <span>Build #{this.props.build.number}</span>
          <span></span>
        </div>
      
    );
  }
}

export default Relay.createContainer(Build, {
  fragments: {
    build: () =&gt; Relay.QL`
      fragment on Build {
        id
        url
        number
        createdAt
      }
    `
  }
});