Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): fix cf-modules integration test #1812

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/@graphql-yoga_plugin-apq-1794-dependencies.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/graphql-yoga-1794-dependencies.md

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
npmToken: ${{ secrets.NODE_AUTH_TOKEN }}

dependencies:
uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@main
secrets:
githubToken: ${{ secrets.GUILD_BOT_TOKEN }}
# dependencies:
# uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@main
# secrets:
# githubToken: ${{ secrets.GUILD_BOT_TOKEN }}
6 changes: 3 additions & 3 deletions e2e/tests/create-cf-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export function createCFDeployment(
'utf-8',
),
module: isModule,
secretTextBindings: [
plainTextBindings: [
{
name: 'GRAPHQL_ROUTE',
text: `/${stackName}`,
name: 'GRAPHQL_ENDPOINT',
text: stackName,
},
{
name: 'DEBUG',
Expand Down
22 changes: 19 additions & 3 deletions examples/cloudflare-modules/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
// src/index.mjs
import { createYoga, createSchema } from 'graphql-yoga'

declare const GRAPHQL_ENDPOINT: string

const { fetch } = createYoga({
graphqlEndpoint: '/graphql',
landingPage: false,
graphqlEndpoint: GRAPHQL_ENDPOINT || '/graphql',
schema: createSchema({
typeDefs: /* GraphQL */ `
type Query {
greetings: String
}
type Subscription {
time: String
}
`,
resolvers: {
Query: {
greetings: () =>
'This is the `greetings` field of the root `Query` type',
},
Subscription: {
time: {
subscribe: () =>
new Repeater((push, end) => {
const interval = setInterval(
() => push(new Date().toISOString()),
1000,
)
end.then(() => clearInterval(interval))
}),
resolve: (value) => value,
},
},
},
}),
})
Expand Down
5 changes: 2 additions & 3 deletions examples/service-worker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { createYoga, createSchema, Repeater } from 'graphql-yoga'

// We can define GraphQL Route dynamically using env vars.
declare var GRAPHQL_ROUTE: string
declare const GRAPHQL_ENDPOINT: string

const yoga = createYoga({
graphqlEndpoint: GRAPHQL_ROUTE || '/graphql',
graphqlEndpoint: GRAPHQL_ENDPOINT || '/graphql',
schema: createSchema({
typeDefs: /* GraphQL */ `
type Query {
Expand Down
2 changes: 1 addition & 1 deletion packages/subscription/src/createPubSub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type ChannelPubSubConfig<
* The event target. If not specified an (in-memory) EventTarget will be created.
* For multiple server replica or serverless environments a distributed EventTarget is recommended.
*
* An event dispatched on the event target MUST have a `data` property.
* An event dispatched on the event target MUST have a `detail` property.
*/
eventTarget?: PubSubEventTarget<TPubSubPublishArgsByKey>
}
Expand Down