Skip to content

refactor: 💥 ♻️ replace Apollo/Zenroom/raw-GQL with @interfacer/client SDK#870

Draft
phoebus-84 wants to merge 10 commits into
mainfrom
refactor/sdk-client
Draft

refactor: 💥 ♻️ replace Apollo/Zenroom/raw-GQL with @interfacer/client SDK#870
phoebus-84 wants to merge 10 commits into
mainfrom
refactor/sdk-client

Conversation

@phoebus-84

@phoebus-84 phoebus-84 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

BREAKING CHANGE: Removes @apollo/client and graphql dependencies.
All GQL operations, Zenroom crypto, and external REST calls now
delegate to @interfacer/client SDK.

Key changes:
- AuthContext: Zenroom keypairoom → SDK AuthClient
- useProjectCRUD: raw GQL mutations → SDK ResourceClient
- useInBox/useWallet/useSocial: raw REST → SDK Inbox/Wallet/Social clients
- useAutoimport: raw Octokit → SDK ImportClient
- useResourceSpecs: Apollo → SDK getInstanceVariables
- lib/dpp.ts: raw fetch → SDK DppClient
- lib/fileUpload.ts: Zenroom hash → SDK FileClient
- lib/tagging.ts: re-exports from SDK TaggingClient
- lib/createApolloClient.ts: Apollo → SDK GraphQLClient
- lib/apollo-compat.tsx: Apollo useQuery/useMutation compat layer
  (aliased via tsconfig paths + webpack for zero-change migration)
- pages/sign_in.tsx: Zenroom doLogin → SDK auth.recreateKeys
- Removed Zenroom WASM dynamic imports from AuthContext

TypeScript: 0 errors (tsc --noEmit passes)
Next.js build: reaches compilation (pre-existing Node 25 incompat)

… SDK

BREAKING CHANGE: Removes @apollo/client and graphql dependencies.
All GQL operations, Zenroom crypto, and external REST calls now
delegate to @interfacer/client SDK.

Key changes:
- AuthContext: Zenroom keypairoom → SDK AuthClient
- useProjectCRUD: raw GQL mutations → SDK ResourceClient
- useInBox/useWallet/useSocial: raw REST → SDK Inbox/Wallet/Social clients
- useAutoimport: raw Octokit → SDK ImportClient
- useResourceSpecs: Apollo → SDK getInstanceVariables
- lib/dpp.ts: raw fetch → SDK DppClient
- lib/fileUpload.ts: Zenroom hash → SDK FileClient
- lib/tagging.ts: re-exports from SDK TaggingClient
- lib/createApolloClient.ts: Apollo → SDK GraphQLClient
- lib/apollo-compat.tsx: Apollo useQuery/useMutation compat layer
  (aliased via tsconfig paths + webpack for zero-change migration)
- pages/sign_in.tsx: Zenroom doLogin → SDK auth.recreateKeys
- Removed Zenroom WASM dynamic imports from AuthContext

TypeScript: 0 errors (tsc --noEmit passes)
Next.js build: reaches compilation (pre-existing Node 25 incompat)
- Removed: history/*, skills-lock.json, geo-search.md, enniogol.stl, manuelrdlg.txt
- Restored AGPL-3.0 SPDX license headers in:
  hooks/useSignedPost.ts, hooks/useAuth.tsx, lib/fileUpload.ts

Re: AuthContext as client init location — yes, it's the right place.
It's the natural successor to the old ApolloProvider and provides
the SDK client to all children via React Context. The alternative
would be accepting a pre-built client as AuthProvider prop.
@phoebus-84 phoebus-84 marked this pull request as draft June 29, 2026 14:37
- Remove link:../interfacer-client from package.json
- Update all imports across 9 source files to use @dyne/interfacer-client
- Regenerate pnpm-lock.yaml
Previously returned hardcoded empty stubs — project creation would fail.
Now calls getInstanceVariables() via useEffect and populates all 6 spec
IDs from the Zenflows instance. Falls back to empty values while loading.

TypeScript: 0 errors
…flow

- Updated @dyne/interfacer-client to 0.2.9 (ProjectType enum fix)
- Use SDK's InstanceVariables type, removed specDpp from hasAllSpecs guard
- Pass processId + locationId to createProject, avoiding duplicates
- Removed overly strict projectTypes guard in handleProjectCreation
…hange

Session restore useEffect had router.asPath in deps, causing
client.auth.login() on every navigation. Any network failure in
that call wiped localStorage and logged the user out.
Changed to use stable publicPage dependency instead.
- Replaced empty uploadFiles() stub with client.files.uploadToDpp()
- Store DPP file URLs in metadata.image (single URL or array)
- findProjectImages already supports metadata.image for display
- Matches the fix from interfacer-init-data (commit 92d2ca2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant