fix: cors
parent
298ed2097a
commit
5782ab8a77
|
|
@ -3,7 +3,7 @@ import { GraphQLClient, Variables, RequestOptions } from 'graphql-request'
|
||||||
export const graphQLClient = new GraphQLClient(
|
export const graphQLClient = new GraphQLClient(
|
||||||
`${process.env.NEXT_PUBLIC_TABBY_SERVER_URL ?? ''}/graphql`,
|
`${process.env.NEXT_PUBLIC_TABBY_SERVER_URL ?? ''}/graphql`,
|
||||||
{
|
{
|
||||||
credentials: 'include',
|
// credentials: 'include',
|
||||||
mode: 'cors'
|
mode: 'cors'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@ pub async fn attach_webserver(
|
||||||
"/graphql",
|
"/graphql",
|
||||||
routing::post(graphql::<Arc<Schema>>).with_state(ctx.clone()),
|
routing::post(graphql::<Arc<Schema>>).with_state(ctx.clone()),
|
||||||
)
|
)
|
||||||
|
.route("/graphql", routing::get(playground("/graphql", None)))
|
||||||
.layer(Extension(schema))
|
.layer(Extension(schema))
|
||||||
.route("/hub", routing::get(ws_handler).with_state(ctx.clone()));
|
.route("/hub", routing::get(ws_handler).with_state(ctx.clone()));
|
||||||
|
|
||||||
let ui = ui
|
let ui = ui
|
||||||
.route("/graphql", routing::get(playground("/graphql", None)))
|
|
||||||
.route("/graphiql", routing::get(graphiql("/graphql", None)))
|
.route("/graphiql", routing::get(graphiql("/graphql", None)))
|
||||||
.fallback(ui::handler);
|
.fallback(ui::handler);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue