- Notifications
You must be signed in to change notification settings - Fork6
Net client APIs for Optimizely Graph with sample sites, Free and Open
License
episerver/graph-net-sdk
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
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.
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
Before you contribute to this project, ensure you have the following installed:
- .NET SDK 6+
- SQL Server 2016 Express LocalDB (download here)
From repository level:
- Run
cd msbuild - Run
powershell .\unitTest.ps1if you're using Command Line or.\unitTest.ps1if PowerShell
- Configure appsettings.json file in
.\APIs\src\Testing\EPiServer.ContentGraph.IntegrationTeststo connect to GraphQL gateway.If appsettings.json was ready, from repository level: - Run
cd msbuild - Run
powershell .\intergrationTest.ps1if you're using Command Line or.\intergrationTest.ps1if PowerShell
- 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.
- Run
dotnet run --launch-profile "Kestrel (Env: Development)" - Go tologin page and login with account:
adminand password:Find@123. - GotoOptimizely Graph content synchronization job then click
Start. - After the job is completed, go toSearch page and try your query.
- On the way...
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.
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:
- Run
dotnet new tool-manifest - Run
dotnet 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.
You have an ASP.NET project inc:\dev\alloy\, and the following file setup
alloy.sln\src alloy.csproj \Models \Controllers ...\docs readme.md- Open a command prompt at the root of your ASP.NET project (
c:\dev\alloy\) - Run the following command:
dotnet new tool-manifest - This will generate a
.configfolder with a dotnet tool manifest - Run the following command:
dotnet tool install Optimizely.Graph.Client.Tools --local - This will register the ogschema tool in the manifest, and allow the tool to be invoked anywhere in or below
c:\dev\alloy\ - Change to your src directory:
cd src - Run the following command:
dotnet ogschema appsettings.json Models - This will generate a file called
GraphModels.csin the Models directory
In this example, yourappSettings.config file must have the necessary Optimizely Graph settings. See thedeveloper documentation for more information.
dotnet ogschema <settingsfile> <output> <optional-source> <optional-namespace>
settingsfile: Relative or full path to an appSettings.json file with Graph configurationoutput: Relative or full path to a directory or .cs file to write generated C# models tooptional-source: The content source in your Graph instance, default value is:defaultoptional-namespace: The namespace for the generated C# classes
The following command:dotnet ogschema appsettings.json Models\MyContentSource.cs dt1 Alloy.Models
- will look for an
appsettings.jsonfile in the current directory - will create a file called
MyContentSource.csin theModelsdirectory below the current directory - will generate model classes for thecontent source called
dt1. This could be a custom content source that you have created previously - The namespace used in the
MyContentSource.csfile will beAlloy.Models
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.
- 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.
- 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.
- If you have any questions about how to use the SDK or about the source code itself, join the conversation on theOptimizely World forum.
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.