Skip to content

Commit 8da9b40

Browse files
committed
Added InputObjectType support
1 parent 9ffef05 commit 8da9b40

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

release.sh

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
11
#!/bin/zsh
22

3+
#Fetch remote tags
4+
git fetch origin 'refs/tags/*:refs/tags/*'
5+
6+
#Variables
37
LAST_VERSION=$(git tag -l | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
48
NEXT_VERSION=$(echo $LAST_VERSION | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')
59
VERSION=${1-${NEXT_VERSION}}
610
DEFAULT_MESSAGE="Release"
711
MESSAGE=${2-${DEFAULT_MESSAGE}}
812
RELEASE_BRANCH="release/$VERSION"
913

14+
# Commit uncommited changes
1015
git add .
1116
git commit -am $MESSAGE
12-
git push
13-
14-
# Create release branch
15-
git checkout -b $RELEASE_BRANCH develop
16-
gulp build
17-
git add .
18-
git commit -am "Build $NEXT_VERSION"
19-
git push origin $RELEASE_BRANCH
17+
git push origin develop
2018

21-
# Merge release branch in master
19+
# Merge develop branch in master
2220
git checkout master
23-
git merge $RELEASE_BRANCH
24-
25-
# Merge release branch in develop
26-
git checkout develop
27-
git merge $RELEASE_BRANCH
28-
git push origin develop
21+
git merge develop
2922

3023
# Tag and push master
31-
git checkout master
3224
git tag $VERSION
3325
git push origin master --tags
3426

35-
# Remove release branch
36-
git branch -d $RELEASE_BRANCH
37-
3827
# Return to develop
3928
git checkout develop

src/Folklore/GraphQL/Support/Type.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
use Illuminate\Support\Fluent;
66

77
use GraphQL\Type\Definition\ObjectType;
8+
use GraphQL\Type\Definition\InputObjectType;
89
use GraphQL\Type\Definition\InterfaceType;
910

1011
class Type extends Fluent {
1112

1213
protected static $instances = [];
14+
protected static $inputObject = false;
1315

1416
public function attributes()
1517
{
@@ -28,13 +30,14 @@ public function interfaces()
2830

2931
protected function getFieldResolver($name, $field)
3032
{
33+
$resolveMethod = 'resolve'.studly_case($name).'Field';
3134
if(isset($field['resolve']))
3235
{
3336
return $field['resolve'];
3437
}
35-
else if(method_exists($this, 'resolve'.studly_case($name).'Field'))
38+
else if(method_exists($this, $resolveMethod))
3639
{
37-
$resolver = array($this, 'resolve'.studly_case($name).'Field');
40+
$resolver = array($this, $resolveMethod);
3841
return function() use ($resolver)
3942
{
4043
$args = func_get_args();
@@ -106,6 +109,10 @@ public function toArray()
106109

107110
public function toType()
108111
{
112+
if($this->inputObject)
113+
{
114+
return new InputObjectType($this->toArray());
115+
}
109116
return new ObjectType($this->toArray());
110117
}
111118

0 commit comments

Comments
 (0)