-
Notifications
You must be signed in to change notification settings - Fork 75
Added FileData
type instead of a Stream
to provide a Content Type of a file
#532
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
Conversation
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.
Pull Request Overview
Introduces a new FileData
record to carry both the file stream and its content type through the GraphQL upload path, and updates all relevant contexts, schema definitions, server handlers, and tests.
- Defined
FileData
and changedIInputExecutionContext.GetFile
to return it. - Updated
coerceFileValue
,FileType
, and request context to useFileData
. - Adjusted tests and mock helpers to include and verify content type information.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/FSharp.Data.GraphQL.Tests/Helpers.fs | Added mockContentType constant and updated mock context to return FileData . |
tests/FSharp.Data.GraphQL.Tests/FileTests.fs | Changed test inputs to FileData , added getFullInfo helper, and updated expected assertions. |
src/FSharp.Data.GraphQL.Shared/SchemaDefinitions.fs | Updated coerceFileValue and FileType to operate on FileData instead of raw streams. |
src/FSharp.Data.GraphQL.Shared/InputContext.fs | Introduced the FileData record and modified the IInputExecutionContext signature. |
src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs | Wrapped ASP.NET Core uploaded files in FileData with ContentType . |
Comments suppressed due to low confidence (2)
src/FSharp.Data.GraphQL.Shared/InputContext.fs:3
- [nitpick] Add XML documentation for the
FileData
record to clarify the purpose of theStream
andContentType
fields for consumers.
type FileData = {
src/FSharp.Data.GraphQL.Shared/SchemaDefinitions.fs:486
- [nitpick] Update the
FileType
description to mention that content type information is now captured via theFileData
record.
let FileType : InputCustomDefinition<FileData> = {
src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs
Outdated
Show resolved
Hide resolved
src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs
Outdated
Show resolved
Hide resolved
src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs
Outdated
Show resolved
Hide resolved
…ploadFileContentTypeFix # Conflicts: # src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs
FileData
type instead of a Stream
to provide a Content Type of a file
No description provided.