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

fix: replace skip with skipOnClient to avoid runtime errors #2751

Merged

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Oct 14, 2024

follows #2743

Changes:

  • Updated useControllableValue hook in EndpointSelect component to explicitly type it with string
  • Changed @skip directive to @skipOnClient in GraphQL query for the endpoint field

Rationale:

  • The explicit typing of useControllableValue<string> improves type safety and clarity in the codebase
  • Switching from @skip to @skipOnClient directive likely aligns with updated GraphQL schema or client-side optimization strategies

Effects:

  • These changes should not directly affect users
  • Developers will benefit from improved type checking and potentially more efficient GraphQL query execution
  • Avoid runtime errors when endpoint is empty.

How to test:

  1. Remove all services
  2. Enable enableLLMPlayground from config.toml
  3. Visit LLM Playground page

Checklist for reviewer:

  • Check if runtime error disappears.

Checklist:

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Oct 14, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @agatha197 and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the size:XS ~10 LoC label Oct 14, 2024
Copy link

github-actions bot commented Oct 14, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 5.33% 348/6533
🔴 Branches 4.82% 218/4522
🔴 Functions 3.1% 67/2163
🔴 Lines 5.22% 333/6381

Test suite run success

93 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from e43f244

@agatha197 agatha197 force-pushed the fix/replace-skip-with-skipOnClient-to-avoid-runtime-errors branch from 39c2902 to 0956095 Compare October 14, 2024 14:01
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

The GraphQL server performs argument type checking before evaluating directives. Therefore, even when using @skip, the argument types must be adhered to. For convenience, let's use @skipOnClient only when using the uuid argument. In all other cases, consider @skip first.

Copy link

graphite-app bot commented Oct 21, 2024

Merge activity

follows #2743

**Changes:**

- Updated `useControllableValue` hook in `EndpointSelect` component to explicitly type it with `string`
- Changed `@skip` directive to `@skipOnClient` in GraphQL query for the `endpoint` field

**Rationale:**

- The explicit typing of `useControllableValue<string>` improves type safety and clarity in the codebase
- Switching from `@skip` to `@skipOnClient` directive likely aligns with updated GraphQL schema or client-side optimization strategies

**Effects:**

- These changes should not directly affect users
- Developers will benefit from improved type checking and potentially more efficient GraphQL query execution
- Avoid runtime errors when endpoint is empty.

**How to test:**
1. Remove all services
2. Enable `enableLLMPlayground` from config.toml
3. Visit LLM Playground page

**Checklist for reviewer:**
- [ ] Check if runtime error disappears.

**Checklist:**

- [x] Mention to the original issue
- [ ] Documentation
- [ ] Minium required manager version
- [x] Specific setting for review (eg., KB link, endpoint or how to setup)
- [x] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@yomybaby yomybaby force-pushed the fix/replace-skip-with-skipOnClient-to-avoid-runtime-errors branch from 0956095 to e43f244 Compare October 21, 2024 01:56
@graphite-app graphite-app bot merged commit e43f244 into main Oct 21, 2024
7 checks passed
@graphite-app graphite-app bot deleted the fix/replace-skip-with-skipOnClient-to-avoid-runtime-errors branch October 21, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS ~10 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants