Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #135

Merged
merged 4 commits into from
May 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,39 @@ The QueryBuilder class is a utility to help construct GraphQL mutations from Far
Example constructing the GraphQL mutation that upserts an application and deployment.

```ts
// The QueryBuilder manages origin for you
const qb = new QueryBuilder(ORIGIN);
// The QueryBuilder manages origin for you
const qb = new QueryBuilder(ORIGIN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in my PR but lets make this 'example-origin' or something as the const hasn't been defined yet in this snippet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to push to my branch and merge


const application: MutationParams = {
model: 'compute_Application',
key: {
name: '<application_name>',
platform: '<application_platform>',
},
};
const deployment: MutationParams = {
model: 'cicd_Deployment',
key: {
uid: '<deployment_uid',
source: '<deployment_source>',
},
body: {
// Fields that reference another model need to be refs
application: qb.ref(application),
status: {
category: 'Success',
detail: '<status_detail>',
},
},
};
const application: MutationParams = {
model: 'compute_Application',
key: {
name: '<application_name>',
platform: '<application_platform>',
},
};
const deployment: MutationParams = {
model: 'cicd_Deployment',
key: {
uid: '<deployment_uid',
source: '<deployment_source>',
},
body: {
// Fields that reference another model need to be refs
application: qb.ref(application),
status: {
category: 'Success',
detail: '<status_detail>',
},
},
};

const mutations = [
qb.upsert(application),
qb.upsert(deployment)
];
const mutations = [
qb.upsert(application),
qb.upsert(deployment)
];

// Send your mutations to Faros!
await client.sendMutations(mutations);
// Send your mutations to Faros!
await client.sendMutations(mutations);
```

Please read the [Faros documentation][farosdocs] to learn more.
Expand Down