Skip to content

Commit

Permalink
Update graphql syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdsupremacist committed Aug 16, 2021
1 parent b41db10 commit 03d661a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/Graphaello.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "add --project /Users/mathiasquintero/CovidUI --apollo derivedData --apiName GAPI https://api-eu-central-1.graphcms.com/v2/ckqxy4gw1m2gb01z6gj25c7nf/master"
argument = "add --project /Users/mathiasquintero/Desktop/Test --skipCache --apiName GAPI https://api-eu-central-1.graphcms.com/v2/ckqxy4gw1m2gb01z6gj25c7nf/master"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/nerdsupremacist/graphql-syntax.git",
"state": {
"branch": null,
"revision": "c5a5fee955569cdb799b15b0c8c07318a52cea55",
"version": "0.1.2"
"revision": "76fee68f4fe1ee08f6d7ce4dad1fed102c2a557a",
"version": "0.1.3"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMajor(from: "0.27.0")),
.package(url: "https://github.com/nerdsupremacist/CLIKit.git", .upToNextMajor(from: "0.3.7")),
.package(url: "https://github.com/nerdsupremacist/graphql-syntax.git", .upToNextMajor(from: "0.1.2")),
.package(url: "https://github.com/nerdsupremacist/graphql-syntax.git", .upToNextMajor(from: "0.1.3")),
.package(url: "https://github.com/nerdsupremacist/Stencil.git", .upToNextMajor(from: "0.13.2")),
.package(name: "XcodeProj", url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.5.0")),
.package(url: "https://github.com/nicklockwood/SwiftFormat.git", .upToNextMajor(from: "0.42.0")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ struct BasicGraphQLToSwiftTranspiler: GraphQLToSwiftTranspiler {
return (field.name, try expression(from: value, for: field.type, using: api))
} ?? []

return FunctionCallExprSyntax(target: MemberAccessExprSyntax(base: IdentifierExprSyntax(identifier: api.name),
name: name),
let target = MemberAccessExprSyntax(base: IdentifierExprSyntax(identifier: api.name),
name: name)

return FunctionCallExprSyntax(target: target,
arguments: expressions)

case (.identifier(let identifier), .concrete(let type)) where type.kind == .enum:
guard let name = type.name?.upperCamelized else { break }
return MemberAccessExprSyntax(base: MemberAccessExprSyntax(base: IdentifierExprSyntax(identifier: api.name),
name: name),
let base = MemberAccessExprSyntax(base: IdentifierExprSyntax(identifier: api.name),
name: name)

return MemberAccessExprSyntax(base: base,
name: identifier.camelized)

case (.int(let int), .concrete(let type)) where type.kind == .scalar:
Expand Down

0 comments on commit 03d661a

Please sign in to comment.