/* eslint-disable react-hooks/rules-of-hooks */
// @snippet start example
import { useQuery } from "convex/react";
import { api } from "../convex/_generated/api";
export function App() {
// the URL `param` might be null
const param = new URLSearchParams(window.location.search).get("param");
// ERROR! React Hook "useQuery" is called conditionally. React Hooks must
// be called in the exact same order in every component render.
const data = param !== null ? useQuery(api.functions.read, { param }) : null;
//...
}
// @snippet end example
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'
If you have feedback or need assistance with the MCP directory API, please join our Discord server