Skip to content

Commit

Permalink
Merge pull request #78 from graphql-dotnet/no-void-return-types
Browse files Browse the repository at this point in the history
Ignore properties and methods of type `void`
  • Loading branch information
Tommy Lillehagen authored Oct 24, 2017
2 parents 94448a2 + 2d79c38 commit 9932071
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/GraphQL.Conventions/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[assembly: AssemblyCopyright("Copyright 2016-2017 Tommy Lillehagen. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.3.7")]
[assembly: AssemblyInformationalVersion("1.3.7")]
[assembly: AssemblyFileVersion("1.3.8")]
[assembly: AssemblyInformationalVersion("1.3.8")]
[assembly: CLSCompliant(false)]

[assembly: InternalsVisibleTo("Tests")]
2 changes: 1 addition & 1 deletion src/GraphQL.Conventions/GraphQL.Conventions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>GraphQL Conventions for .NET</Description>
<VersionPrefix>1.3.7</VersionPrefix>
<VersionPrefix>1.3.8</VersionPrefix>
<Authors>Tommy Lillehagen</Authors>
<TargetFrameworks>netstandard1.5;net45</TargetFrameworks>
<DebugType>portable</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private static bool HasValidReturnType(MemberInfo memberInfo)
{
return true;
}
return returnType != typeof(object);
return returnType != typeof(object) && returnType != typeof(void);
}
}
}
2 changes: 1 addition & 1 deletion test/Tests/Attributes/MetaData/DeprecatedAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FieldData

class ArgumentData
{
public void Field(bool arg1, [Deprecated("Some argument reason")] bool arg2) { }
public int Field(bool arg1, [Deprecated("Some argument reason")] bool arg2) { return 0; }
}

class EnumData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FieldData

class ArgumentData
{
public void Field(bool arg1, [Description("Some argument description")] bool arg2) { }
public int Field(bool arg1, [Description("Some argument description")] bool arg2) { return 0; }
}

class EnumData
Expand Down
2 changes: 1 addition & 1 deletion test/Tests/Attributes/MetaData/InjectAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Arguments_Can_Be_Injected()

class ArgumentData
{
public void Field(string arg1, [Inject] bool arg2, int arg3) { }
public int Field(string arg1, [Inject] bool arg2, int arg3) { return 0; }
}
}
}
2 changes: 1 addition & 1 deletion test/Tests/Attributes/MetaData/NameAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FieldData

class ArgumentData
{
public void Field(bool normalArg, [Name("someArg")] bool overriddenArg) { }
public int Field(bool normalArg, [Name("someArg")] bool overriddenArg) { return 0; }
}

class EnumData
Expand Down
3 changes: 3 additions & 0 deletions test/Tests/Builders/SchemaConstructorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public void Can_Construct_Schema()
schema.ShouldHaveMutations(0);
schema.Query.ShouldHaveFieldWithName("foo");
schema.Query.ShouldHaveFieldWithName("bar");
schema.Query.ShouldNotHaveFieldWithName("ignored");
}

[Test]
Expand All @@ -39,6 +40,8 @@ class QueryType1
public string Foo => "Test";

public int Bar => 12345;

public void Ignored() { }
}

class MutationType1
Expand Down

0 comments on commit 9932071

Please sign in to comment.