-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
Refactor GitLoader #1796
Refactor GitLoader #1796
Conversation
@@ -34,11 +34,9 @@ export type GitLoaderOptions = SingleFileOptions & { | |||
/** | |||
* Additional options to pass to `graphql-tag-pluck` | |||
*/ | |||
pluckConfig: GraphQLTagPluckOptions; | |||
pluckConfig?: GraphQLTagPluckOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this optional since graphql-tag-pluck
doesn't actually require an options object to be passed in.
} | ||
} | ||
|
||
function ensureSource({ rawSDL, pointer, path }: { rawSDL: string; pointer: string; path: string }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping ensureSource
and createInvalidExtensionError
because gqlPluckFromCodeString
guarantees a string is returned and will already throw if an extension is invalid.
83f95dd
to
fb9b3d1
Compare
fb9b3d1
to
c91596a
Compare
The latest changes of this PR are available as alpha in npm: Quickly update your package.json by running:
|
The existing GitLoader's
loadSync
function is broken because it usessimple-git
andsimple-git
does not provide a way to execute git commands synchronously -- its API either uses Promises or callbacks. This PR refactors the loader to utilizeexec
/execSync
instead and adds tests.