Enumerationgraphqlswift.graphql 3.0.0GraphQL
DataEncodingStrategy
The strategy to use for encoding Data
values.
enum DataEncodingStrategy
Cases
case deferredToData
Defer to
Data
for choosing an encoding.case base64
Encoded the
Data
as a Base64-encoded string. This is the default strategy.case custom((Data, Encoder) throws -> Void)
Encode the
Data
as a custom value encoded by the given closure.
Other members in extension
Types
enum DateEncodingStrategy
The strategy to use for encoding
Date
values.enum KeyEncodingStrategy
The strategy to use for automatically changing the value of keys before encoding.
enum NonConformingFloatEncodingStrategy
The strategy to use for non-Any-conforming floating-point values (IEEE 754 infinity and NaN).
struct OutputFormatting
The formatting of the output Any data.
Type members
init(
) Initializes
self
with default strategies.
Instance members
var dataEncodingStrategy: DataEncodingStrategy
The strategy to use in encoding binary data. Defaults to
.base64
.var dateEncodingStrategy: DateEncodingStrategy
The strategy to use in encoding dates. Defaults to
.deferredToDate
.var keyEncodingStrategy: KeyEncodingStrategy
The strategy to use for encoding keys. Defaults to
.useDefaultKeys
.var nonConformingFloatEncodingStrategy: NonConformingFloatEncodingStrategy
The strategy to use in encoding non-conforming numbers. Defaults to
.throw
.var outputFormatting: OutputFormatting
The output format to produce. Defaults to
[]
.var userInfo: [CodingUserInfoKey : Any]
Contextual user-provided information for use during encoding.
func encode<T>(T
) throws -> Any Encodes the given top-level value and returns its Any representation.