Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Update SSR to use hooks and testing utilities from common
Browse files Browse the repository at this point in the history
  • Loading branch information
hwillson committed Nov 6, 2019
1 parent 540b14f commit c34e1f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
9 changes: 6 additions & 3 deletions packages/ssr/src/__tests__/useLazyQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import React from 'react';
import { DocumentNode } from 'graphql';
import gql from 'graphql-tag';
import { mockSingleLink } from '@apollo/react-testing';
import { ApolloProvider, useLazyQuery } from '@apollo/react-hooks';
import { renderToStringWithData } from '@apollo/react-ssr';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import {
ApolloClient,
InMemoryCache,
ApolloProvider,
useLazyQuery
} from '@apollo/react-common';

describe('useLazyQuery Hook SSR', () => {
const CAR_QUERY: DocumentNode = gql`
Expand Down
10 changes: 6 additions & 4 deletions packages/ssr/src/__tests__/useQuery.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import { DocumentNode } from 'graphql';
import gql from 'graphql-tag';
import { ApolloProvider } from '@apollo/react-common';
import { MockedProvider, mockSingleLink } from '@apollo/react-testing';
import { useQuery } from '@apollo/react-hooks';
import {
ApolloProvider,
useQuery,
ApolloClient,
InMemoryCache
} from '@apollo/react-common';
import { renderToStringWithData } from '@apollo/react-ssr';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { render, wait } from '@testing-library/react';

describe('useQuery Hook SSR', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/ssr/src/getDataFromTree.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { getApolloContext } from '@apollo/react-common';
import { RenderPromises } from '@apollo/react-hooks';
import { getApolloContext, RenderPromises } from '@apollo/react-common';

export function getDataFromTree(
tree: React.ReactNode,
Expand Down

0 comments on commit c34e1f5

Please sign in to comment.