-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(client): SwiftGraphQL 3.0.0 (#70)
BREAKING CHANGE: This PR improves query building logic and introduces a new full-blown GraphQL client.
- Loading branch information
Showing
274 changed files
with
188,725 additions
and
5,797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Migrate TheSocialNetwork Database | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
migrate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Main | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Install dependencies | ||
run: yarn workspaces focus tsn-server | ||
|
||
- name: Deploy Migration | ||
run: yarn workspace tsn-server deploy | ||
env: | ||
DATABASE_URL: ${{ secrets.DATABASE_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
name: Create a GitHub release | ||
name: Create GitHub Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
paths: | ||
- 'Sources/**/*' | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# Test | ||
- name: Perform unit tests. | ||
run: | | ||
swift package resolve | ||
swift build | ||
swift test | ||
- name: Tests integrations from examples. | ||
run: ./scripts/test.sh | ||
|
||
# Release | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
# Relevant Branches | ||
release_branches: main | ||
pre_release_branches: next | ||
# Tag configuration | ||
tag_prefix: '' | ||
default_bump: false | ||
default_bump: 'patch' | ||
# Credentials | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create a GitHub release | ||
uses: actions/create-release@v1 | ||
env: | ||
|
@@ -40,3 +35,17 @@ jobs: | |
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
release_name: SwiftGraphQL ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
if: steps.tag_version.outputs.new_tag != null | ||
|
||
- name: Create Release | ||
run: | | ||
make update_brew_formula | ||
make update_podspec | ||
git add . | ||
git commit -m "Update Formula and PodSpec to $(VERSION)" | ||
git push origin main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ steps.tag_version.outputs.new_version }} | ||
if: steps.tag_version.outputs.new_tag != null |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,40 @@ | ||
name: Test | ||
name: Test Packages | ||
|
||
on: | ||
push: {} | ||
pull_request: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
test: | ||
name: Test Sources | ||
|
||
runs-on: macos-12 | ||
|
||
timeout-minutes: 30 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Resolve | ||
|
||
# Build the Library | ||
- name: Swift Resolve | ||
run: swift package resolve | ||
- name: Build | ||
- name: Swift Build | ||
run: swift build | ||
- name: Perform package tests | ||
|
||
# Start Test Server | ||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Install Server Dependencies | ||
run: yarn install | ||
- name: Start Test Server | ||
run: yarn workspace server start & | ||
- name: Wait for Server to Start | ||
run: | | ||
sleep 5 | ||
# Perform Tests | ||
- name: Test Package | ||
run: swift test | ||
- name: Integration tests with workflows | ||
run: ./scripts/test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
*.log* | ||
.env* | ||
|
||
# Swift | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug swift-graphql", | ||
"program": ".build/debug/swift-graphql", | ||
"args": [], | ||
"cwd": "${workspaceFolder:swift-graphql}", | ||
"preLaunchTask": "swift: Build Debug swift-graphql" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Release swift-graphql", | ||
"program": ".build/release/swift-graphql", | ||
"args": [], | ||
"cwd": "${workspaceFolder:swift-graphql}", | ||
"preLaunchTask": "swift: Build Release swift-graphql" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Test swift-graphql", | ||
"program": "/Applications/Xcode.app/Contents/Developer/usr/bin/xctest", | ||
"args": [".build/debug/swift-graphqlPackageTests.xctest"], | ||
"cwd": "${workspaceFolder:swift-graphql}", | ||
"preLaunchTask": "swift: Build All" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.wordWrap": "on" | ||
"editor.wordWrap": "on", | ||
"lldb.library": "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Contributing to SwiftGraphQL | ||
|
||
Hey :wave:! This library is a collaborative effort of many people and we are all very excited to see you here. This file will help you navigate around more easily and make sure your pull requests receive attention they deserve. | ||
|
||
This package is best developed using Swift command line tools. | ||
|
||
> NOTE: SwiftGraphQL depends on `swift-format` that relies on `SwiftSyntax` that is distributed as part of the Swift toolchain. It's important that you set the correct version of Swift Command Line Tools when developing so that the tools match the version of `swift-format` used. | ||
```sh | ||
swift package tools-version --set 5.5 | ||
``` | ||
|
||
## Code Organization | ||
|
||
SwiftGraphQL is split into multiple packages that serve different purposes. | ||
|
||
1. **GraphQL** contains the structures that appear in all GraphQL requests, | ||
1. **GraphQLAST** describes the models and methods used for fetching information about the schema, | ||
1. **GraphQLWebSocket** implements a [GraphQL over WebSocket protocol](https://github.com/enisdenjo/graphql-ws), | ||
1. **SwiftGraphQL** is a query builder library, | ||
1. **SwiftGraphQLCodegen** generates methods that you may use to build type-safe queries, | ||
1. **SwiftGraphQLCLI** exposes a ready to use CLI tool for code generation. | ||
|
||
## Roadmap | ||
|
||
Feel free to contribute in any way possible. We are excited about your ideas and want to share them with the rest of the world. It's often even more helpful to write a well documented idea than to write code because ["code is the easy part"](https://www.youtube.com/watch?v=DSjbTC-hvqQ). | ||
|
||
We are currently investing our efforts into | ||
|
||
- Swift Docc Reference of the library, | ||
- Normalized Caching exchange, | ||
- Subscriptions over SSE exchange, | ||
- SwiftUI bindings | ||
|
||
Contributing in any of these topics will get a lot of attention and have top priority. | ||
|
||
> If you have any questions about the library, feel free to reach out to Matic at `matic.zavadlal [at] gmail.com`. | ||
## Creating a Pull Request | ||
|
||
> Every PR should follow a common structure. This way, it's easier for people to navigate the code, look back at the PRs and understand why library has evolved the way it has. | ||
Every PR should follow the next set of guidelines | ||
|
||
1. Title should be well-formated (e.g. "Add WebSocket Support for Apple Watch", not "add WS for apple watch"). | ||
1. The first comment should clearly outline what you've changed and, if necessary, why. | ||
1. Make sure that comments in the PR and in the code are grammatically correct. | ||
1. Check _all_ your changes in GitHub files tab before _again_ before requesting a review. | ||
1. Suggest a release type (e.g. patch, minor, major) for your change. | ||
|
||
## Building Binary and Documentation | ||
|
||
```sh | ||
swift build -c release --product swift-graphql --disable-sandbox | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
0821319
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
swift-graphql – ./
swift-graphql-maticzav.vercel.app
swift-graphql-git-main-maticzav.vercel.app
www.swift-graphql.com
swift-graphql.vercel.app
swift-graphql.com