This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GraphQLArgument): introduce optional arguments
Extend GraphQLArgument annotation class with field "optional" (default to false for backward compatibility) Clean "null" stings in valueOf handling of argument values, treat as null reference Handle optional values in Property query message generation
- Loading branch information
Showing
13 changed files
with
173 additions
and
25 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
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
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
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 |
---|---|---|
|
@@ -26,4 +26,5 @@ | |
String name(); | ||
String value() default "null"; | ||
String type() default "null"; | ||
boolean optional() default false; | ||
} |
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
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
34 changes: 34 additions & 0 deletions
34
nodes/src/test/java/io/aexp/nodes/graphql/models/NestedTestModelOptionalArguments.java
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,34 @@ | ||
/* | ||
* Copyright (c) 2018 American Express Travel Related Services Company, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.aexp.nodes.graphql.models; | ||
|
||
public class NestedTestModelOptionalArguments { | ||
|
||
private String string; | ||
|
||
public String getString() { | ||
return string; | ||
} | ||
|
||
public void setString(String anotherTestString) { | ||
this.string = anotherTestString; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "NestedTestModelOptionalArguments{" + | ||
"string='" + string + '\'' + | ||
'}'; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
nodes/src/test/java/io/aexp/nodes/graphql/models/TestModelOptionalArguments.java
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,40 @@ | ||
/* | ||
* Copyright (c) 2018 American Express Travel Related Services Company, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.aexp.nodes.graphql.models; | ||
|
||
import io.aexp.nodes.graphql.annotations.GraphQLArgument; | ||
import io.aexp.nodes.graphql.annotations.GraphQLArguments; | ||
import io.aexp.nodes.graphql.annotations.GraphQLProperty; | ||
|
||
@GraphQLProperty(name = "test") | ||
public class TestModelOptionalArguments { | ||
@GraphQLArguments({ | ||
@GraphQLArgument(name = "first", type = "Integer", optional = true), | ||
@GraphQLArgument(name = "last", type = "Integer", optional = true) | ||
}) | ||
private NestedTestModelOptionalArguments nested; | ||
|
||
public NestedTestModelOptionalArguments getNested() { | ||
return nested; | ||
} | ||
|
||
public void setNestedTestModelOptionalArguments(NestedTestModelOptionalArguments nested) { | ||
this.nested = nested; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TestModelOptionalArguments{" + "nested=" + nested + '}'; | ||
} | ||
} |
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