How to use the react-relay.createPaginationContainer 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 OpenCTI-Platform / opencti / opencti-front / src / private / components / vulnerability / Vulnerabilities.js View on Github external
if (!this.props.relay.hasMore() || this.props.relay.isLoading()) {
      return;
    }
    // Fetch the next 10 feed items
    this.props.relay.loadMore(2, () => {
      // console.log(error);
    });
  }
}

Vulnerabilities.propTypes = {
  data: PropTypes.object,
  relay: PropTypes.object,
};

export default createPaginationContainer(
  Vulnerabilities,
  {
    data: graphql`
        fragment Vulnerabilities_data on Query @argumentDefinitions(
            count: {type: "Int", defaultValue: 25}
            cursor: {type: "ID"}
            orderBy: {type: "UsersOrdering", defaultValue: ID}
        ) {
            users(
                first: $count
                after: $cursor
                orderBy: $orderBy # Non-pagination variables
            ) @connection(key: "Pagination_users") {
                edges {
                    node {
                        id
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / common / stix_domain_entities / StixDomainEntitiesLines.js View on Github external
export const stixDomainEntitiesLinesSearchQuery = graphql`
  query StixDomainEntitiesLinesSearchQuery($search: String, $types: [String]) {
    stixDomainEntities(search: $search, types: $types) {
      edges {
        node {
          id
          name
          entity_type
        }
      }
    }
  }
`;

const StixDomainEntitiesLines = createPaginationContainer(
  StixDomainEntitiesContainer,
  {
    data: graphql`
      fragment StixDomainEntitiesLines_data on Query
        @argumentDefinitions(
          search: { type: "String" }
          count: { type: "Int", defaultValue: 25 }
          cursor: { type: "ID" }
          orderBy: { type: "StixDomainEntitiesOrdering", defaultValue: "name" }
          orderMode: { type: "OrderingMode", defaultValue: "asc" }
        ) {
        stixDomainEntities(
          search: $search
          first: $count
          after: $cursor
          orderBy: $orderBy
github atom / github / lib / containers / accumulators / review-summaries-accumulator.js View on Github external
const resultBatch = this.props.pullRequest.reviews.edges.map(edge => edge.node);

    return (
      
        {this.props.children}
      
    );
  }
}

export default createPaginationContainer(ReviewSummariesAccumulator, {
  pullRequest: graphql`
    fragment reviewSummariesAccumulator_pullRequest on PullRequest
    @argumentDefinitions(
      reviewCount: {type: "Int!"}
      reviewCursor: {type: "String"},
    ) {
      url
      reviews(
        first: $reviewCount
        after: $reviewCursor
      ) @connection(key: "ReviewSummariesAccumulator_reviews") {
        pageInfo {
          hasNextPage
          endCursor
        }
github artsy / emission / src / lib / Components / Inbox / Conversations / Messages.tsx View on Github external
this.flatListHeight = height
        }}
        onContentSizeChange={(_width, height) => {
          this.setState({
            shouldStickFirstMessageToTop: height < this.flatListHeight,
          })
        }}
        refreshControl={refreshControl}
        style={messagesStyles}
        ListFooterComponent={}
      />
    )
  }
}

export default createPaginationContainer(
  Messages,
  {
    conversation: graphql`
      fragment Messages_conversation on Conversation
        @argumentDefinitions(count: { type: "Int", defaultValue: 10 }, after: { type: "String" }) {
        id
        internalID
        from {
          name
          email
          initials
        }
        to {
          name
          initials
        }
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / threats / intrusion_sets / IntrusionSetsCards.js View on Github external
$orderMode: OrderingMode
    $filters: [IntrusionSetsFiltering]
  ) {
    ...IntrusionSetsCards_data
      @arguments(
        search: $search
        count: $count
        cursor: $cursor
        orderBy: $orderBy
        orderMode: $orderMode
        filters: $filters
      )
  }
`;

export default createPaginationContainer(
  IntrusionSetsCards,
  {
    data: graphql`
      fragment IntrusionSetsCards_data on Query
        @argumentDefinitions(
          search: { type: "String" }
          count: { type: "Int", defaultValue: 25 }
          cursor: { type: "ID" }
          orderBy: { type: "IntrusionSetsOrdering", defaultValue: "name" }
          orderMode: { type: "OrderingMode", defaultValue: "asc" }
          filters: { type: "[IntrusionSetsFiltering]" }
        ) {
        intrusionSets(
          search: $search
          first: $count
          after: $cursor
github artsy / reaction / src / Components / Gene / Contents.tsx View on Github external
gene: {
    mode: string | null
    name: string | null
    filtered_artworks: {
      aggregations: Array<{ slice: string }>
      artworks: {
        pageInfo: {
          hasNextPage: boolean
          endCursor: string
        }
      }
    }
  }
}

export default createPaginationContainer(
  GeneContentsUrl,
  {
    gene: graphql.experimental`
      fragment Contents_gene on Gene
        @argumentDefinitions(
          count: { type: "Int", defaultValue: 10 }
          cursor: { type: "String", defaultValue: "" }
          showArtists: { type: "Boolean", defaultValue: true }
          sort: { type: "String", defaultValue: "-partner_updated_at" }
          for_sale: { type: "Boolean", defaultValue: false }
          medium: { type: "String", defaultValue: "*" }
          aggregations: { type: "[ArtworkAggregation]", defaultValue: [MEDIUM, TOTAL, PRICE_RANGE, DIMENSION_RANGE] }
          price_range: { type: "String", defaultValue: "*" }
          dimension_range: { type: "String", defaultValue: "*" }
        ) {
        mode
github itdagene-ntnu / itdagene-webapp / components / Joblistings / JoblistingsContainer.js View on Github external
: joinValues(node.towns.map(({ name }) => name))}
                  
                
              
            
          ))}

        {props.root && props.root.joblistings.edges.length === 0 && (
          <h2> Ingen annonser :( </h2>
        )}
      
    
  
);

export const JoblistingsList = createPaginationContainer(
  ListRenderer,
  {
    root: graphql`
      fragment JoblistingsContainer_root on Query
        @argumentDefinitions(
          count: { type: "Int", defaultValue: 30 }
          cursor: { type: "String" }
          type: { type: "String" }
          fromYear: { type: "Float" }
          toYear: { type: "Float" }
          company: { type: "ID" }
          towns: { type: "[ID]", defaultValue: [] }
          orderBy: { type: "[OrderByJoblistingType]" }
        ) {
        joblistings(
          first: $count
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / common / external_references / AddExternalReferencesLines.js View on Github external
t: PropTypes.func,
  fld: PropTypes.func,
};

export const addExternalReferencesLinesQuery = graphql`
  query AddExternalReferencesLinesQuery(
    $search: String
    $count: Int!
    $cursor: ID
  ) {
    ...AddExternalReferencesLines_data
      @arguments(search: $search, count: $count, cursor: $cursor)
  }
`;

const AddExternalReferencesLines = createPaginationContainer(
  AddExternalReferencesLinesContainer,
  {
    data: graphql`
      fragment AddExternalReferencesLines_data on Query
        @argumentDefinitions(
          search: { type: "String" }
          count: { type: "Int", defaultValue: 25 }
          cursor: { type: "ID" }
        ) {
        externalReferences(search: $search, first: $count, after: $cursor)
          @connection(key: "Pagination_externalReferences") {
          edges {
            node {
              id
              source_name
              description
github ErrorPro / relay-compose / src / index.js View on Github external
export const paginationContainer = (query, connectionConfig) => Component => createPaginationContainer(
  Component,
  query,
  connectionConfig,
);
github renanmav / relay-twitter / src / pages / Feed / index.tsx View on Github external
onEndReached={handleOnEndReached}
          onRefresh={handleOnRefresh}
          refreshing={refreshing}
        /&gt;
         navigation.navigate("NewTweet")} /&gt;
      
    
  );
};

Feed.navigationOptions = {
  title: "Início",
  headerRight: 
};

const FeedPaginationContainer = createPaginationContainer(
  Feed,
  {
    query: graphql`
      fragment Feed_query on Query {
        tweets(first: $count, after: $cursor) @connection(key: "Feed_tweets") {
          edges {
            node {
              id
              _id
              content
              likes
              retweets
              author {
                name
              }
            }