Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Net client APIs for Optimizely Graph with sample sites, Free and Open

License

NotificationsYou must be signed in to change notification settings

episerver/graph-net-sdk

 
 

Repository files navigation

The Optimizely Graph Client SDKs have been deprecated. This repository is provided as read-only for reference purposes. It is no longer maintained and no longer receives any updates.

Optimizely Graph Client SDKs

Welcome to the Optimizely Graph Client SDK repository! This project is dedicated to building GraphQL queries with just a few lines of C# code, aimed at supporting Optimizely's customers in constructing search queries forOptimizely Graph, similar toSearch & Navigation.There are other alternatives that can be utilized to use the Optimizely Graph like.Net GraphQL andStrawberry Shake

Getting Started

Prerequisites

Before you contribute to this project, ensure you have the following installed:

Runing Tests locally

Run Unit tests

From repository level:

  • Runcd msbuild
  • Runpowershell .\unitTest.ps1 if you're using Command Line or.\unitTest.ps1 if PowerShell

Run Integration tests

  • Configure appsettings.json file in.\APIs\src\Testing\EPiServer.ContentGraph.IntegrationTests to connect to GraphQL gateway.If appsettings.json was ready, from repository level:
  • Runcd msbuild
  • Runpowershell .\intergrationTest.ps1 if you're using Command Line or.\intergrationTest.ps1 if PowerShell

Run Alloy template site

  • Configure appsettings.json file to connect to outside environments or your local environment. If you use your local environment, connect Alloy site to your local GraphQL gateway.
  • Rundotnet run --launch-profile "Kestrel (Env: Development)"
  • Go tologin page and login with account:admin and password:Find@123 .
  • GotoOptimizely Graph content synchronization job then clickStart.
  • After the job is completed, go toSearch page and try your query.

Run Foundation template site

  • On the way...

Optimizely Graph Client Tool

This tool will generate C# classes (models) based on Optimizely Graph's schema. The Client SDK graph builder classes uses these models to provide strongly typed access to the Graph data.

Install Optimizely Graph Client Tool

You typically want to install this tool into your solution directory. It is installed as adotnet tool which you can invoke using thedotnet command. If you install the tool at the root of your solution (where your .sln and/or .git directory is located), the command will also work in all subdirectories.Open a command line, navigate to the root of your repository/solution:

  • Rundotnet new tool-manifest
  • Rundotnet tool install Optimizely.Graph.Client.Tools --local

You can now invoke theogschema tool using the follwing command:
dotnet ogschema path_to_your_appsettings.json path_to_store_your_models

This will create a fileGraphModels.cs in thepath_to_store_your_models directory.

Example installation

You have an ASP.NET project inc:\dev\alloy\, and the following file setup

alloy.sln\src  alloy.csproj  \Models  \Controllers  ...\docs  readme.md
  1. Open a command prompt at the root of your ASP.NET project (c:\dev\alloy\)
  2. Run the following command:dotnet new tool-manifest
  3. This will generate a.config folder with a dotnet tool manifest
  4. Run the following command:dotnet tool install Optimizely.Graph.Client.Tools --local
  5. This will register the ogschema tool in the manifest, and allow the tool to be invoked anywhere in or belowc:\dev\alloy\
  6. Change to your src directory:cd src
  7. Run the following command:dotnet ogschema appsettings.json Models
  8. This will generate a file calledGraphModels.cs in the Models directory

In this example, yourappSettings.config file must have the necessary Optimizely Graph settings. See thedeveloper documentation for more information.

Command Line Reference

dotnet ogschema <settingsfile> <output> <optional-source> <optional-namespace>

  • settingsfile: Relative or full path to an appSettings.json file with Graph configuration
  • output: Relative or full path to a directory or .cs file to write generated C# models to
  • optional-source: The content source in your Graph instance, default value is:default
  • optional-namespace: The namespace for the generated C# classes

The following command:
dotnet ogschema appsettings.json Models\MyContentSource.cs dt1 Alloy.Models

  1. will look for anappsettings.json file in the current directory
  2. will create a file calledMyContentSource.cs in theModels directory below the current directory
  3. will generate model classes for thecontent source calleddt1. This could be a custom content source that you have created previously
  4. The namespace used in theMyContentSource.cs file will beAlloy.Models

Contributing

We welcome contributions from the community! Here's how you can contribute:

  • Fork the repository: Start by forking the repository to your GitHub account.
  • Build and Test Locally: Ensure you can build the project and run tests successfully on your local environment. It's crucial that you run all tests locally and achieve full test coverage before submitting a pull request, as external contributors won't have access to run tests using our GitHub actions without prior approval.
  • Pull Requests: When you're ready, submit a pull request with your changes. Make sure your pull request description clearly describes the changes and the purpose, including if it fixes a bug or adds a new feature. Include the relevant issue number if applicable.
  • Running Tests: Please ensure you have run all tests successfully locally and achieved full test coverage before submitting a pull request.

Did You Find a Bug?

  • If the bug is a security vulnerability, please contactsupport@optimizely.com directly instead of opening up a GitHub issue.
  • Check if the bug has already been reported by searching underIssues on GitHub.
  • If you're unable to find an open issue addressing the problem, feel free toopen a new one. Please include a title and clear description, as much relevant information as possible, and a code sample or executable test case demonstrating the expected behavior that is not occurring.

Proposing a New Feature or Change

  • We appreciate your suggestions for new features or changes to existing ones! To ensure alignment with the project's direction, please start by filing an issue and initiating a discussion before submitting a large pull request.

Questions About the Source Code

  • If you have any questions about how to use the SDK or about the source code itself, join the conversation on theOptimizely World forum.

Documentation

Thank you for contributing to the Optimizely Graph Client SDK!

About

Net client APIs for Optimizely Graph with sample sites, Free and Open

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp