Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Upgraded versions
Browse files Browse the repository at this point in the history
  • Loading branch information
floric committed Feb 10, 2019
1 parent e2eb5f4 commit d939008
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 133 deletions.
10 changes: 6 additions & 4 deletions packages/frontend/src/components/HandledQuery.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component, ReactNode } from 'react';

import { OperationVariables } from 'apollo-client';
import { DocumentNode } from 'graphql';
import { Query, QueryResult } from 'react-apollo';
import { Redirect, Route } from 'react-router-dom';
Expand All @@ -12,13 +13,14 @@ export interface HandledQueryProps<Data, Variables> {
children: (data: QueryResult<Data, Variables>) => ReactNode;
}

export class HandledQuery<Data, Variables = null> extends Component<
HandledQueryProps<Data, Variables>
> {
export class HandledQuery<
Data,
Variables = OperationVariables
> extends Component<HandledQueryProps<Data, Variables>> {
public render() {
const { query, variables, children } = this.props;
return (
<Query<Data, Variables> query={query} variables={variables}>
<Query<Data, Variables> query={query} variables={variables as any}>
{result => {
const { loading, error } = result;
if (loading) {
Expand Down
Loading

0 comments on commit d939008

Please sign in to comment.