Skip to content

Commit

Permalink
fix(generators): Remove apollo by default (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzotki authored Nov 13, 2024
1 parent 48d60da commit 1999b84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/create/bin/create-gene-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async function runCommands() {
'[email protected]',
'[email protected]',
'[email protected]',
'@apollo/[email protected]',
'[email protected]',
]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import { Container } from 'inversify';
import { factory, Factory } from '@brainly-gene/core';
import { ServiceTypes } from '@brainly-gene/core';
import { QueryClient } from '@tanstack/react-query';
import { ApolloClient, InMemoryCache, NormalizedCacheObject } from '@apollo/client';
import { Container } from "inversify";
import { factory, Factory } from "@brainly-gene/core";
import { ServiceTypes } from "@brainly-gene/core";
import { QueryClient } from "@tanstack/react-query";
// import { ApolloClient, InMemoryCache, NormalizedCacheObject } from '@apollo/client';

export function useServiceClientsContainer() {
const apolloClient = new ApolloClient({
uri: 'https://mockurl.com',
cache: new InMemoryCache(),
ssrMode: true,
});
// const apolloClient = new ApolloClient({
// uri: 'https://mockurl.com',
// cache: new InMemoryCache(),
// ssrMode: true,
// });
const queryClient = new QueryClient();

const clients = {
[ServiceTypes.reactQuery]: () => {
return queryClient;
},
[ServiceTypes.apollo]: () => {
return apolloClient;
},
// [ServiceTypes.apollo]: () => {
// return apolloClient;
// },
};

const container = new Container();
container
.bind<Factory<QueryClient | ApolloClient<NormalizedCacheObject>>>(
'serviceFactory'
)
// .bind<Factory<QueryClient | ApolloClient<NormalizedCacheObject>>>(
.bind<Factory<QueryClient>>("serviceFactory")
.toFunction(factory(clients));

return container;
Expand Down

0 comments on commit 1999b84

Please sign in to comment.