<!-- Thanks for filing an issue on Apollo Client! Please make sure that you include the following information to ensure that your issue is actionable. If you don't follow the template, your issue may end up being closed without anyone looking at it carefully, because it is not actionable for us without the information in this template. **PLEASE NOTE:** Feature requests and non-bug related discussions are no longer managed in this repo. Feature requests should be opened in https://github.com/apollographql/apollo-feature-requests. --> **Intended outcome:** A typical reason for `skip`ing a `useQuery()` is the query is not yet ready to be called, for whatever reason. Take the given example: ```js import {useState} from 'react' import { DocumentNode, gql, useQuery } from '@apollo/client'; export default function ReactComponent() { const [query, setQuery] = useState<DocumentNode | undefined>( undefined, ); const res = useQuery(query, { ssr: true, skip: !query }); return ( <></> ) } ``` The intended outcome here ought to be if the `query` is not a `DocumentNode` and `skip` is `true`, it should not throw an error: ``` Invariant Violation: Argument of undefined passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document ``` <!-- What you were trying to accomplish when the bug occurred, and as much code as possible related to the source of the problem. --> **Actual outcome:** The following error is thrown: ``` Invariant Violation: Argument of undefined passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document ``` **How to reproduce the issue:** 1. Create a component with the following code: ```js import {useState} from 'react' import { DocumentNode, gql, useQuery } from '@apollo/client'; export default function ReactComponent() { const [query, setQuery] = useState<DocumentNode | undefined>( undefined, ); const res = useQuery(query, { skip: !query }); return ( <></> ) } ``` 2. Notice the error: `Invariant Violation: Argument of undefined passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document` **Versions** ``` System: OS: macOS 12.4 Binaries: Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node npm: 8.18.0 - ~/.nvm/versions/node/v16.16.0/bin/npm Browsers: Chrome: 104.0.5112.101 Edge: 104.0.1293.70 Firefox: 92.0.1 Safari: 15.5 ``` ``` "next": "^12.1.6", "react": "^17.0.2", "react-dom": "^17.0.2", "@apollo/client": "^3.6.6", ```