Copies apps/extension, apps/mobile and 10 pkgs (wallet, ui, config, utilities, sessions, gating, notifications, analytics, eslint-config, prices) into a standalone pnpm workspace. Resolves merge conflict markers in extension and mobile package.json files, strips build artifacts (.wxt, .output, Pods).
Swift Mobile GraphQL Schema
This Framework contains autogenerated code that is generated from running Apollo iOS graphQL codegen. This code is not checked in, but the generated files are referenced for the Xcode build process.
Generating the Swift GraphQL Schema
They run automatically as part of WidgetsCore build phases.
If you encounter build errors after updating the GraphQL schema:
-
Missing file references: If Xcode complains about missing files, run
bun mobile ios:prebuildagain to ensure all files are properly added to the project. -
Script failures: If the automatic file addition fails, you may see a warning. In this case, try running the script manually:
cd apps/mobile && ruby ./scripts/update_apollo_files_in_xcode.rb -
Manual file addition: If the script consistently fails, you can add files manually (see the "Adding Generated Files Manually" section below).
-
Clean build: Sometimes a clean build helps resolve reference issues:
cd apps/mobile/ios && xcodebuild clean -
Check for schema errors: Ensure there are no errors in your GraphQL schema or queries.
Adding Generated Files Manually
If you need to manually add new GraphQL queries or fragments to Swift:
- Ensure the file is listed in
apps/mobile/ios/apollo-codegen-config.json's"operationSearchPaths"and"schemaSearchPaths" - Add the needed generated files to the XCode project. To add new files:
- Right-click the
WidgetsCorefolder in XCode - Select
add files to "Uniswap"... - Select the
MobileSchemafolder - Keep
Action: Reference files in placeselected - Keep
Groups: Create Groupsselected - Keep
WidgetsCorechecked - Click Finish
- Right-click the
Implementation Details
The automation for adding generated files to Xcode uses a Ruby script (scripts/update_apollo_files_in_xcode.rb) that:
- Removes any existing MobileSchema group from the Xcode project
- Creates a new MobileSchema group with the proper structure
- Scans the MobileSchema directory for Swift files
- Adds files to the appropriate groups in the Xcode project
- Updates the build phases to include the new files
Requirements
The script requires the xcodeproj Ruby gem:
gem install xcodeproj
Note: This should already have been installed via the mobile app's setup instructions.
Debugging
If the script fails, you can run it with debugging output:
DEBUG=1 ruby ./scripts/update_apollo_files_in_xcode.rb