Skip to content

Commit

Permalink
Updated Test Snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Nov 7, 2022
1 parent 159d34d commit 8a4c297
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
Expand Up @@ -17,16 +17,17 @@ public static async ValueTask<object> AwaitTaskHelper<T>(Task<T> task)
return await task.ConfigureAwait(false);
}

public static async ValueTask<object> AwaitValueTaskHelper<T>(ValueTask<T> task) =>
await task.ConfigureAwait(false);
public static async ValueTask<object> AwaitValueTaskHelper<T>(ValueTask<T> task)
=> await task.ConfigureAwait(false);

public static ValueTask<object> WrapResultHelper<T>(T result) => new(result);
public static ValueTask<object> WrapResultHelper<T>(T result)
=> new(result);

public static TContextData GetGlobalState<TContextData>(
IDictionary<string, object> contextData,
string key,
bool defaultIfNotExists = false) =>
GetGlobalStateWithDefault<TContextData>(contextData, key, defaultIfNotExists, default);
bool defaultIfNotExists = false)
=> GetGlobalStateWithDefault<TContextData>(contextData, key, defaultIfNotExists, default);

public static TContextData GetGlobalStateWithDefault<TContextData>(
IDictionary<string, object> contextData,
Expand All @@ -36,7 +37,7 @@ public static async ValueTask<object> AwaitTaskHelper<T>(Task<T> task)
{
if (contextData.TryGetValue(key, out var value))
{
if (value is null)
if (ReferenceEquals(value, null))
{
return default;
}
Expand All @@ -57,20 +58,20 @@ public static async ValueTask<object> AwaitTaskHelper<T>(Task<T> task)

public static SetState<TContextData> SetGlobalStateGeneric<TContextData>(
IDictionary<string, object> contextData,
string key) =>
value => contextData[key] = value;
string key)
=> value => contextData[key] = value;

public static SetState SetGlobalState(
IDictionary<string, object> contextData,
string key) =>
value => contextData[key] = value;
string key)
=> value => contextData[key] = value;

public static TContextData GetScopedState<TContextData>(
IPureResolverContext context,
IReadOnlyDictionary<string, object> contextData,
string key,
bool defaultIfNotExists = false) =>
GetScopedStateWithDefault<TContextData>(
bool defaultIfNotExists = false)
=> GetScopedStateWithDefault<TContextData>(
context, contextData, key, defaultIfNotExists, default);

public static TContextData GetScopedStateWithDefault<TContextData>(
Expand Down Expand Up @@ -104,21 +105,21 @@ public static async ValueTask<object> AwaitTaskHelper<T>(Task<T> task)

public static SetState<TContextData> SetScopedStateGeneric<TContextData>(
IResolverContext context,
string key) =>
value => context.ScopedContextData = context.ScopedContextData.SetItem(key, value);
string key)
=> value => context.ScopedContextData = context.ScopedContextData.SetItem(key, value);

public static SetState SetScopedState(
IResolverContext context,
string key) =>
value => context.ScopedContextData = context.ScopedContextData.SetItem(key, value);
string key)
=> value => context.ScopedContextData = context.ScopedContextData.SetItem(key, value);

public static SetState<TContextData> SetLocalStateGeneric<TContextData>(
IResolverContext context,
string key) =>
value => context.LocalContextData = context.LocalContextData.SetItem(key, value);
string key)
=> value => context.LocalContextData = context.LocalContextData.SetItem(key, value);

public static SetState SetLocalState(
IResolverContext context,
string key) =>
value => context.LocalContextData = context.LocalContextData.SetItem(key, value);
string key)
=> value => context.LocalContextData = context.LocalContextData.SetItem(key, value);
}
@@ -1,3 +1,3 @@
For more details look at the `Errors` property.

1. The type `Qux` implements the node interface but does not provide a node resolver for re-fetching.
1. The type `Qux` implements the node interface but does not provide a node resolver for re-fetching. (HotChocolate.Types.ObjectType<HotChocolate.Types.NodeTypeTests.Qux>)

0 comments on commit 8a4c297

Please sign in to comment.