diff --git a/src/Speckle.Sdk/Api/GraphQL/Models/Workspace.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Workspace.cs
index 745f54ad..807212bd 100644
--- a/src/Speckle.Sdk/Api/GraphQL/Models/Workspace.cs
+++ b/src/Speckle.Sdk/Api/GraphQL/Models/Workspace.cs
@@ -1,3 +1,5 @@
+using Speckle.Newtonsoft.Json;
+
namespace Speckle.Sdk.Api.GraphQL.Models;
public class LimitedWorkspace
@@ -6,8 +8,12 @@ public class LimitedWorkspace
public string name { get; init; }
public string? role { get; init; }
public string slug { get; init; }
- public string? logo { get; init; }
+ public string? logoUri { get; init; }
public string? description { get; init; }
+
+ [JsonIgnore]
+ [Obsolete($"Deprecated, use {nameof(logoUri)} instead", true)]
+ public string? logo { get; init; }
}
public class Workspace : LimitedWorkspace
@@ -16,9 +22,13 @@ public class Workspace : LimitedWorkspace
public DateTime updatedAt { get; init; }
public bool readOnly { get; init; }
public WorkspacePermissionChecks permissions { get; init; }
+
+ [JsonIgnore]
+ [Obsolete("Workspaces no longer have creation state, is always created true", true)]
public WorkspaceCreationState? creationState { get; init; }
}
+[Obsolete("Workspaces no longer have creation state, is always created true")]
public sealed class WorkspaceCreationState
{
public bool completed { get; init; }
diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs
index cb545181..4e828918 100644
--- a/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs
+++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs
@@ -264,15 +264,11 @@ query ActiveUser($limit: Int!, $cursor: String, $filter: UserWorkspacesFilter) {
name
role
slug
- logo
+ logoUrl
createdAt
updatedAt
readOnly
description
- creationState
- {
- completed
- }
permissions {
canCreateProject {
authorized
@@ -317,7 +313,7 @@ query ActiveUser($limit: Int!, $cursor: String, $filter: UserWorkspacesFilter) {
/// note this returns a , because it may be a workspace the user is not a member of
///
/// The ActiveUser could not be found (e.g. the client is not authenticated)
- public async Task GetActiveWorkspace(CancellationToken cancellationToken = default)
+ private async Task GetActiveWorkspace_Legacy(CancellationToken cancellationToken = default)
{
//language=graphql
const string QUERY = """
@@ -328,7 +324,6 @@ query ActiveUser {
name
role
slug
- logo
description
}
}
@@ -349,6 +344,47 @@ query ActiveUser {
return response.data.data;
}
+ public async Task GetActiveWorkspace(CancellationToken cancellationToken = default)
+ {
+ //language=graphql
+ const string QUERY = """
+ query ActiveUser {
+ data:activeUser {
+ data:activeWorkspace {
+ id
+ name
+ role
+ slug
+ logoUrl
+ description
+ }
+ }
+ }
+ """;
+
+ var request = new GraphQLRequest { Query = QUERY };
+
+ NullableResponse?> response;
+ try
+ {
+ response = await _client
+ .ExecuteGraphQLRequest?>>(request, cancellationToken)
+ .ConfigureAwait(false);
+ }
+ catch (SpeckleGraphQLInvalidQueryException)
+ {
+ //v2.x.x servers do not have a logoUrl property
+ return await GetActiveWorkspace_Legacy(cancellationToken).ConfigureAwait(false);
+ }
+
+ if (response.data is null)
+ {
+ throw new SpeckleException("GraphQL response indicated that the ActiveUser could not be found");
+ }
+
+ return response.data.data;
+ }
+
/// Max number of projects to fetch
/// Optional cursor for pagination
/// Optional filter
diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs
index 309d1255..26d46256 100644
--- a/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs
+++ b/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs
@@ -52,7 +52,6 @@ query LimitedUser($id: String!) {
/// String to search for. Must be at least 3 characters
/// Max number of users to fetch
/// Optional cursor for pagination
- ///
///
///
///
@@ -61,26 +60,25 @@ public async Task UserSearch(
string query,
int limit = ServerLimits.DEFAULT_PAGINATION_REQUEST,
string? cursor = null,
- bool archived = false,
bool emailOnly = false,
CancellationToken cancellationToken = default
)
{
//language=graphql
const string QUERY = """
- query UserSearch($query: String!, $limit: Int!, $cursor: String, $archived: Boolean, $emailOnly: Boolean) {
- data:userSearch(query: $query, limit: $limit, cursor: $cursor, archived: $archived, emailOnly: $emailOnly) {
+ query Users($input: UsersRetrievalInput!) {
+ data:users(input: $input) {
cursor
items {
- id
- name
- bio
- company
- avatar
- verified
- role
- }
- }
+ id
+ name
+ bio
+ company
+ avatar
+ verified
+ role
+ }
+ }
}
""";
@@ -89,11 +87,13 @@ query UserSearch($query: String!, $limit: Int!, $cursor: String, $archived: Bool
Query = QUERY,
Variables = new
{
- query,
- limit,
- cursor,
- archived,
- emailOnly,
+ input = new
+ {
+ query,
+ limit,
+ emailOnly,
+ cursor,
+ },
},
};
diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs
index 8ba201d1..39140230 100644
--- a/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs
+++ b/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs
@@ -76,6 +76,7 @@ subscription UserProjectsUpdated {
/// Subscribe to updates to resource comments/threads. Optionally specify resource ID string to only receive updates regarding comments for those resources
///
///
+ [Obsolete("Comments are now issues, and we've not update SDKs with the new subs")]
public Subscription CreateProjectCommentsUpdatedSubscription(
ViewerUpdateTrackingTarget target
)
diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/WorkspaceResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/WorkspaceResource.cs
index 285c008b..805a4ad6 100644
--- a/src/Speckle.Sdk/Api/GraphQL/Resources/WorkspaceResource.cs
+++ b/src/Speckle.Sdk/Api/GraphQL/Resources/WorkspaceResource.cs
@@ -28,15 +28,11 @@ query WorkspaceGet($workspaceId: String!) {
name
role
slug
- logo
+ logoUrl
createdAt
updatedAt
readOnly
description
- creationState
- {
- completed
- }
permissions {
canCreateProject {
authorized
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/WorkspaceResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/WorkspaceResourceTests.cs
index d597472d..838156e2 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/WorkspaceResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/WorkspaceResourceTests.cs
@@ -21,7 +21,7 @@ private static async Task Setup()
return testUser;
}
- [Fact]
+ [Fact, Trait("Server", "Internal")]
public async Task TestGetWorkspace()
{
var ex = await Assert.ThrowsAsync(async () => _ = await Sut.Get("non-existent-id"));