backend: POST '/servlet/graphql' -> POST '/graphql'
This commit is contained in:
parent
7a6e6f368f
commit
116bf23da3
6 changed files with 18 additions and 21 deletions
|
@ -10,7 +10,7 @@ module Twenty::Servlet::ServerMixin
|
|||
# Returns an instance of WEBrick::HTTPServer.
|
||||
def server(options = {})
|
||||
server = WEBrick::HTTPServer.new server_options.merge(options)
|
||||
server.mount "/servlet/graphql", Twenty::Servlet::GraphQL
|
||||
server.mount "/graphql", Twenty::Servlet::GraphQL
|
||||
server
|
||||
end
|
||||
|
||||
|
|
5
twenty-frontend/src/js/constants.ts
Normal file
5
twenty-frontend/src/js/constants.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { InMemoryCache } from "@apollo/client";
|
||||
export const CLIENT_OPTIONS = {
|
||||
uri: "/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
}
|
|
@ -1,14 +1,12 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { Projects } from "/components/Projects";
|
||||
import { ApolloProvider, ApolloClient, InMemoryCache } from "@apollo/client";
|
||||
import { CLIENT_OPTIONS } from "/constants";
|
||||
import { ApolloProvider, ApolloClient } from "@apollo/client";
|
||||
|
||||
(function () {
|
||||
const root = document.querySelector(".react-root")!;
|
||||
const client = new ApolloClient({
|
||||
uri: "/servlet/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
const client = new ApolloClient(CLIENT_OPTIONS);
|
||||
ReactDOM.createRoot(root).render(
|
||||
<ApolloProvider client={client}>
|
||||
<Projects />
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { ApolloProvider, ApolloClient, InMemoryCache } from "@apollo/client";
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { ApolloProvider, ApolloClient } from "@apollo/client";
|
||||
import { CLIENT_OPTIONS } from "/constants";
|
||||
import { Task as Component } from "/components/Task";
|
||||
|
||||
(function () {
|
||||
|
@ -10,10 +11,7 @@ import { Task as Component } from "/components/Task";
|
|||
.split(",")
|
||||
.map(e => e.split("=")),
|
||||
);
|
||||
const client = new ApolloClient({
|
||||
uri: "/servlet/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
const client = new ApolloClient(CLIENT_OPTIONS);
|
||||
const root = document.querySelector(".react-root")!;
|
||||
ReactDOM.createRoot(root).render(
|
||||
<ApolloProvider client={client}>
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { CLIENT_OPTIONS } from "/constants";
|
||||
import { ApolloClient, ApolloProvider } from "@apollo/client";
|
||||
import { Task } from "/components/Task";
|
||||
import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client";
|
||||
|
||||
(function () {
|
||||
const root = document.querySelector(".react-root")!;
|
||||
const client = new ApolloClient({
|
||||
uri: "/servlet/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
const client = new ApolloClient(CLIENT_OPTIONS);
|
||||
ReactDOM.createRoot(root).render(
|
||||
<ApolloProvider client={client}>
|
||||
<Task />
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import { ApolloClient, InMemoryCache, ApolloProvider } from "@apollo/client";
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { CLIENT_OPTIONS } from "/constants";
|
||||
import { ApolloClient, ApolloProvider } from "@apollo/client";
|
||||
import { Tasks } from "/components/Tasks";
|
||||
|
||||
(function () {
|
||||
const root = document.querySelector(".react-root")!;
|
||||
const client = new ApolloClient({
|
||||
uri: "/servlet/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
const client = new ApolloClient(CLIENT_OPTIONS);
|
||||
ReactDOM.createRoot(root).render(
|
||||
<ApolloProvider client={client}>
|
||||
<Tasks />
|
||||
|
|
Loading…
Reference in a new issue