You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
947 B
22 lines
947 B
import { parser, DocumentType } from "../parser/index.js"; |
|
import { withQuery } from "./query-hoc.js"; |
|
import { withMutation } from "./mutation-hoc.js"; |
|
import { withSubscription } from "./subscription-hoc.js"; |
|
/** |
|
* @deprecated |
|
* Official support for React Apollo higher order components ended in March 2020. |
|
* This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes. |
|
*/ |
|
export function graphql(document, operationOptions) { |
|
if (operationOptions === void 0) { operationOptions = {}; } |
|
switch (parser(document).type) { |
|
case DocumentType.Mutation: |
|
return withMutation(document, operationOptions); |
|
case DocumentType.Subscription: |
|
return withSubscription(document, operationOptions); |
|
case DocumentType.Query: |
|
default: |
|
return withQuery(document, operationOptions); |
|
} |
|
} |
|
//# sourceMappingURL=graphql.js.map
|