Skip to content

Commit

Permalink
add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl committed Sep 4, 2023
1 parent 6f71bc1 commit fabe818
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/updating-graphsdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Updating Microsoft Graph SDK

`pkg/util/graph/graphsdk` is a specially generated version of the Microsoft Graph API SDK. Since it uses the stable v1.0 of the MSGraph API, it is unlikely that it will need to be updated, although updates to the Kiota generation/libraries or new endpoints being required may require this.

If an update is required, perform the following:

1. Install the latest version of [Kiota](https://github.com/microsoft/kiota) (most likely by downloading it and putting it in your `$PATH`).
1. If new endpoints/schemas are required: Add the relevant endpoints and in `hack/graphsdk/openapi.yaml` from the [msgraph-metadata](https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/v1.0/openapi.yaml) version.
1. Run `make generate-kiota` and commit the result.
1. Run `kiota info -d ./hack/graphsdk/openapi.yaml -l Go` to get the version of the Kiota libraries that are needed and update them. Then, commit the result.
3 changes: 3 additions & 0 deletions pkg/util/graph/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ type GraphServiceClient struct {
graphsdk.GraphBaseServiceClient
}

// Create a GraphServiceClient for use.
//
// NOTE: If you want to update the underlying SDK, see docs/updating-graphsdk.md for instructions.
func NewGraphServiceClient(adapter abstractions.RequestAdapter) *GraphServiceClient {
client := graphsdk.NewGraphBaseServiceClient(adapter, store.BackingStoreFactoryInstance)
return &GraphServiceClient{
Expand Down

0 comments on commit fabe818

Please sign in to comment.