Skip to content

Commit d5f41ee

Browse files
committed
fixing CI build errors
1 parent 04453ee commit d5f41ee

File tree

6 files changed

+38
-44
lines changed

6 files changed

+38
-44
lines changed

apps/graphql/.eslintrc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ['@repo/eslint-config/default.cjs'],
5+
}

apps/graphql/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ connections, with Cloudflare OAuth built-in. It integrates tools powered by the
77

88
Currently available tools:
99

10-
| **Category** | **Tool** | **Description** |
11-
| ---------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
12-
| **GraphQL Schema Search** | `graphql_schema_search` | Search the Cloudflare GraphQL API schema for types, fields, and enum values matching a keyword |
13-
| **GraphQL Schema Overview** | `graphql_schema_overview` | Fetch the high-level overview of the Cloudflare GraphQL API schema |
14-
| **GraphQL Type Details** | `graphql_type_details` | Fetch detailed information about a specific GraphQL type |
15-
| **GraphQL Complete Schema** | `graphql_complete_schema` | Fetch the complete Cloudflare GraphQL API schema (combines overview and important type details)|
16-
| **GraphQL Query Execution** | `graphql_query` | Execute a GraphQL query against the Cloudflare API |
17-
| **GraphQL API Explorer** | `graphql_api_explorer` | Generate a Cloudflare [GraphQL API Explorer](https://graphql.cloudflare.com/explorer) link |
10+
| **Category** | **Tool** | **Description** |
11+
| --------------------------- | ------------------------- | ----------------------------------------------------------------------------------------------- |
12+
| **GraphQL Schema Search** | `graphql_schema_search` | Search the Cloudflare GraphQL API schema for types, fields, and enum values matching a keyword |
13+
| **GraphQL Schema Overview** | `graphql_schema_overview` | Fetch the high-level overview of the Cloudflare GraphQL API schema |
14+
| **GraphQL Type Details** | `graphql_type_details` | Fetch detailed information about a specific GraphQL type |
15+
| **GraphQL Complete Schema** | `graphql_complete_schema` | Fetch the complete Cloudflare GraphQL API schema (combines overview and important type details) |
16+
| **GraphQL Query Execution** | `graphql_query` | Execute a GraphQL query against the Cloudflare API |
17+
| **GraphQL API Explorer** | `graphql_api_explorer` | Generate a Cloudflare [GraphQL API Explorer](https://graphql.cloudflare.com/explorer) link |
1818

1919
### Prompt Examples
2020

@@ -42,4 +42,4 @@ Replace the content with the following configuration:
4242
}
4343
```
4444

45-
Once you've set up your configuration file, restart MCP client and a browser window will open showing your OAuth login page. Proceed through the authentication flow to grant the client access to your MCP server. After you grant access, the tools will become available for you to use.
45+
Once you've set up your configuration file, restart MCP client and a browser window will open showing your OAuth login page. Proceed through the authentication flow to grant the client access to your MCP server. After you grant access, the tools will become available for you to use.

apps/graphql/src/graphql.app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ export default {
121121
options,
122122
env.CLOUDFLARE_CLIENT_ID,
123123
env.CLOUDFLARE_CLIENT_SECRET
124-
),
124+
),
125125
// Cloudflare access token TTL
126126
accessTokenTTL: 3600,
127127
clientRegistrationEndpoint: '/register',
128128
}).fetch(req, env, ctx)
129-
}
129+
},
130130
}

apps/graphql/src/tools/graphql.tools.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { z } from 'zod'
21
import * as LZString from 'lz-string'
2+
import { z } from 'zod'
33

44
import type { GraphQLMCP } from '../graphql.app'
55

@@ -72,13 +72,13 @@ const graphQLErrorSchema = z.object({
7272
timestamp: z.string(),
7373
ray_id: z.string(),
7474
}),
75-
});
76-
75+
})
76+
7777
// Define the overall GraphQL response schema
7878
const graphQLResponseSchema = z.object({
7979
data: z.union([z.record(z.unknown()), z.null()]),
8080
errors: z.union([z.array(graphQLErrorSchema), z.null()]),
81-
});
81+
})
8282

8383
/**
8484
* Fetches the high-level overview of the GraphQL schema
@@ -1009,7 +1009,9 @@ export function registerGraphQLTools(agent: GraphQLMCP) {
10091009

10101010
// Generate GraphQL API Explorer link for this query
10111011
const compressedQuery = LZString.compressToEncodedURIComponent(query)
1012-
const compressedVariables = LZString.compressToEncodedURIComponent(JSON.stringify(variables))
1012+
const compressedVariables = LZString.compressToEncodedURIComponent(
1013+
JSON.stringify(variables)
1014+
)
10131015
const explorerUrl = `https://graphql.cloudflare.com/explorer?query=${compressedQuery}&variables=${compressedVariables}`
10141016

10151017
// Check if the response is too large (MCP server will fail if > 1MB)
@@ -1075,32 +1077,34 @@ export function registerGraphQLTools(agent: GraphQLMCP) {
10751077
async (params) => {
10761078
try {
10771079
const { query, variables = {} } = params
1078-
1080+
10791081
// Compress the query and variables using lz-string
10801082
const compressedQuery = LZString.compressToEncodedURIComponent(query)
1081-
const compressedVariables = LZString.compressToEncodedURIComponent(JSON.stringify(variables))
1082-
1083+
const compressedVariables = LZString.compressToEncodedURIComponent(
1084+
JSON.stringify(variables)
1085+
)
1086+
10831087
// Generate the GraphQL API Explorer URL
10841088
const explorerUrl = `https://graphql.cloudflare.com/explorer?query=${compressedQuery}&variables=${compressedVariables}`
1085-
1089+
10861090
return {
10871091
content: [
10881092
{
10891093
type: 'text',
1090-
text: `**[Open in GraphQL Explorer](${explorerUrl})**\n\nYou can click the link above to open the Cloudflare GraphQL API Explorer with your query pre-populated.\n\n**Query:**\n\`\`\`graphql\n${query}\n\`\`\`\n\n${Object.keys(variables).length > 0 ? `**Variables:**\n\`\`\`json\n${JSON.stringify(variables, null, 2)}\n\`\`\`\n` : ''}`
1091-
}
1092-
]
1094+
text: `**[Open in GraphQL Explorer](${explorerUrl})**\n\nYou can click the link above to open the Cloudflare GraphQL API Explorer with your query pre-populated.\n\n**Query:**\n\`\`\`graphql\n${query}\n\`\`\`\n\n${Object.keys(variables).length > 0 ? `**Variables:**\n\`\`\`json\n${JSON.stringify(variables, null, 2)}\n\`\`\`\n` : ''}`,
1095+
},
1096+
],
10931097
}
10941098
} catch (error) {
10951099
return {
10961100
content: [
10971101
{
10981102
type: 'text',
10991103
text: JSON.stringify({
1100-
error: `Error generating GraphQL API Explorer link: ${error instanceof Error ? error.message : String(error)}`
1101-
})
1102-
}
1103-
]
1104+
error: `Error generating GraphQL API Explorer link: ${error instanceof Error ? error.message : String(error)}`,
1105+
}),
1106+
},
1107+
],
11041108
}
11051109
}
11061110
}

apps/graphql/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"extends": "@repo/typescript-config/workers.json"
2+
"extends": "@repo/typescript-config/workers.json",
3+
"include": ["*/**.ts", "./vitest.config.ts", "./types.d.ts"]
34
}

apps/graphql/worker-configuration.d.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
// Generated by Wrangler by running `wrangler types` (hash: c6d245b6498a55f3fab538f83441cc4f)
21
// Runtime types generated with [email protected] 2025-03-10 nodejs_compat
3-
declare namespace Cloudflare {
4-
interface Env {
5-
OAUTH_KV: KVNamespace;
6-
ENVIRONMENT: "development" | "staging" | "production";
7-
MCP_SERVER_NAME: "<PLACEHOLDER>" | "graphql-staging" | "graphql";
8-
MCP_SERVER_VERSION: "<PLACEHOLDER>" | "1.0.0";
9-
CLOUDFLARE_CLIENT_ID: string;
10-
CLOUDFLARE_CLIENT_SECRET: string;
11-
MCP_OBJECT: DurableObjectNamespace /* GraphQLMCP */;
12-
USER_DETAILS: DurableObjectNamespace /* UserDetails */;
13-
MCP_METRICS: AnalyticsEngineDataset;
14-
}
15-
}
16-
interface Env extends Cloudflare.Env {}
17-
182
// Begin runtime types
193
/*! *****************************************************************************
204
Copyright (c) Cloudflare. All rights reserved.

0 commit comments

Comments
 (0)