Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoGraffe committed Nov 2, 2023
1 parent 48eb16e commit 9f17ecf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app/api/zeus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ export const HOST = "http://localhost:8080/v1/graphql"


export const HEADERS = {}
import { createClient, type Sink } from 'graphql-ws'; // keep
import { createClient, type Sink } from 'graphql-ws';

export const apiSubscription = (options: chainOptions) => {

// const headers : Record<string,string> = {};

const h = options[1]?.headers;
// const passedHeaders : HeadersInit = /*options[1]?.headers ??*/ new Headers();
// const h = {'authorization':passedHeaders['authorization'] ?? '','x-hasura-role':passedHeaders['x-hasura-role'] ?? ''};
// const empty : [string, string][] = [];
// const headers : HeadersInit = passedHeaders ? passedHeaders : empty;
const client = createClient({
url: String(options[0]),
// connectionParams: Object.fromEntries(new Headers(options[1]?.headers).entries()),
connectionParams: h ? Object.fromEntries(new Headers(h).entries()) : undefined,

Check failure on line 21 in src/app/api/zeus/index.ts

View workflow job for this annotation

GitHub Actions / build-test

Argument of type 'HeadersInit' is not assignable to parameter of type 'HeadersInit | undefined'.

Check failure on line 21 in src/app/api/zeus/index.ts

View workflow job for this annotation

GitHub Actions / build-test

Argument of type 'HeadersInit' is not assignable to parameter of type 'HeadersInit | undefined'.
});

const ws = new Proxy(
Expand Down

0 comments on commit 9f17ecf

Please sign in to comment.