1 ---
2 sidebar_label: "no-deprecated-remote-query-config"
3 ---
4
5 export const metadata = {
6 title: `no-deprecated-remote-query-config - ESLint plugin rules`,
7 }
8
9 # {metadata.title}
10
11 This rule disallows `req.remoteQueryConfig` in an API route handler, since it's deprecated in favor of `req.queryConfig`.
12
13 ## Severity
14
15 `warn`. This rule is enabled in the [recommended](../../page.mdx#recommended) preset.
16
17 ## What it Targets
18
19 This rule targets files in your project's `src/api` directory. It reports access to `remoteQueryConfig` on a request object, which is deprecated since Medusa v2.2.0.
20
21 The following code is reported by the rule:
22
23 ```ts title="src/api/store/products/route.ts"
24 import { MedusaRequest } from "@medusajs/framework/http"
25
26 export const GET = async (req: MedusaRequest, res) => {
27 const { fields } = req.remoteQueryConfig
28 }
29 ```
30
31 Instead, use `queryConfig`:
32
33 ```ts title="src/api/store/products/route.ts"
34 import { MedusaRequest } from "@medusajs/framework/http"
35
36 export const GET = async (req: MedusaRequest, res) => {
37 const { fields } = req.queryConfig
38 }
39 ```
40
41 ## Why it's Important
42
43 The `remoteQueryConfig` property is deprecated and may be removed in a future release. Using `queryConfig` keeps your routes compatible with current and upcoming Medusa versions.
44
45 ## Fixable
46
47 This rule is auto-fixable. Run the linter with the `--fix` option to apply the fix automatically.
48
49 ## Turn it Off
50
51 To turn off this rule, set it to `off` in your ESLint configuration:
52
53 ```ts title="eslint.config.ts"
54 import { defineConfig } from "eslint/config"
55 import medusa from "@medusajs/eslint-plugin"
56
57 export default defineConfig([
58 ...medusa.configs.recommended,
59 {
60 rules: {
61 "@medusajs/no-deprecated-remote-query-config": "off",
62 },
63 },
64 ])
65 ```
66
67 Or disable it for a single line using an inline comment:
68
69 ```ts
70 // eslint-disable-next-line @medusajs/no-deprecated-remote-query-config
71 const { fields } = req.remoteQueryConfig
72 ```