Sdk4me.GraphQL 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Sdk4me.GraphQL --version 1.2.0
                    
NuGet\Install-Package Sdk4me.GraphQL -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sdk4me.GraphQL" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sdk4me.GraphQL" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Sdk4me.GraphQL" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sdk4me.GraphQL --version 1.2.0
                    
#r "nuget: Sdk4me.GraphQL, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sdk4me.GraphQL@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sdk4me.GraphQL&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Sdk4me.GraphQL&version=1.2.0
                    
Install as a Cake Tool

About

A .NET client for accessing the 4me GraphQL API.

Documentation

More information and documentation can be found on the 4me developer website and on the code4me GitHub repository.

The data entities in the SDK are modeled after the 4me Quality Assurance GraphQL schema, which may include objects or properties that are not yet available in production.

How to use

Minimal example

using Sdk4me.GraphQL;

AuthenticationToken token = new AuthenticationToken("clientID", "clientSecret");
Sdk4meClient client = new(token, "account-name", EnvironmentType.Production, EnvironmentRegion.EU);
Person me = client.Me().Result;
Console.WriteLine($"{me.Name} ({me.PrimaryEmail})");

Querying

PersonQuery query = new PersonQuery()
    .View(PersonView.All)
    .OrderBy(PersonOrderField.Vip, OrderBySortOrder.Descending)
    .Filter(PersonField.CreatedAt, FilterOperator.GreaterThanOrEqualsTo, new DateTime(2020, 1, 1))
    .SelectContacts(new ContactQuery()
        .Select("*"))
    .SelectPermissions(new PermissionQuery()
        .ItemsPerRequest(10)
        .Select(PermissionField.Account, PermissionField.Roles))
    .SelectTeams(new TeamQuery()
        .ItemsPerRequest(10)
        .SelectMembers(new PersonQuery()
            .ItemsPerRequest(50)
            .Select(PersonField.Name)))
    .SelectConfigurationItems(new ConfigurationItemQuery()
        .Select(ConfigurationItemField.Label)
        .ItemsPerRequest(10)
        .SelectRequests(new RequestQuery()
            .ItemsPerRequest(10)
            .Select(RequestField.Subject, RequestField.Supplier)));

DataList<Person> people = client.Get(query).Result;

Mutations

PersonCreatePayload result = await client.Mutation(new PersonCreateInput
{
    Name = "James",
    PrimaryEmail = "James@MyCompany.com",
    Disabled = true,
    EmployeeID = "123",
    TeamIds = new() { "NG1lLnFhL1RlYW0vMjA1MTQ", "NG1lLnFhL1RlYW0vMjA1MGv" },
    Source = "Sdk4me",
    TimeFormat24h = true,
    TimeZone = "Brussels",
    DoNotTranslateLanguages = new() { "en", "nl" }
},
new PersonQuery()
    .Select(PersonField.ID, PersonField.Account),  false);
PersonUpdatePayload result = await client.Mutation(new PersonUpdateInput
{
    ID = "NG1qLfFhL1blcnNvci8ysjMxSjIx",
    PrimaryEmail = "James_Updated@MyCompany.com",
},
new PersonQuery()
    .Select(PersonField.ID, PersonField.PrimaryEmail), true);

Events

RequestEventCreateInput requestCreate = new RequestEventCreateInput()
    .Category(RequestCategory.Incident)
    .Note("The first note")
    .Subject("Sdk4me.GraphQL Test")
    .Source("Sdk4me.GraphQL")
    .SourceID("1")
    .ServiceInstance(416)
    .Impact(RequestImpact.Medium)
    .ConfigurationItem(1998)
    .Team(12);

Request request = await client.CreateEvent(requestCreate);

Feedback

Sdk4me.GraphQL is released as open source under the MIT license. Bug reports are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.4 429 1/8/2025
1.4.3 176 11/3/2024
1.4.2 337 9/8/2024
1.4.1 221 8/3/2024
1.4.0 148 7/14/2024
1.3.2 157 6/30/2024
1.3.1 731 6/15/2024
1.3.0 189 5/4/2024
1.2.1 352 4/6/2024
1.2.0 386 2/3/2024
1.1.3 161 1/21/2024
1.1.2 232 11/28/2023
1.1.1 183 10/27/2023
1.1.0 191 10/15/2023
1.0.9 186 9/19/2023
1.0.8 317 7/23/2023
1.0.7 391 7/10/2023
1.0.6 223 6/25/2023
1.0.5 283 5/21/2023
1.0.4 259 4/10/2023
1.0.3 269 3/21/2023
1.0.2 321 2/19/2023
1.0.1 341 1/28/2023
1.0.0 399 1/26/2023