华盖什么意思| 黄花菜都凉了什么意思| pe什么意思| 人黑穿什么颜色的衣服好看| 胳膊疼痛是什么原因| 接触性皮炎用什么药| 花茶是什么茶| 专科考研需要什么条件| 怀孕胸部会有什么反应| 斜纹棉是什么面料| 什么是低筋面粉| 门齿是指什么地方| 肾亏和肾虚有什么区别| 胃出血有什么症状| 梦见喝酒是什么意思| blk是什么意思| 肠炎可以吃什么食物| 台湾什么时候统一| 蚊子会传染什么病| 红酒是什么味道| 12月3号是什么星座| 什么是多囊卵巢综合症| 10.5是什么星座| 什么时候割包皮最好| 碳14阴性是什么意思| 梦见走错路是什么意思| 晒太阳有什么好处| 开水烫了用什么紧急处理| 尿道口灼热感吃什么药最快| 排卵是什么意思啊| 失眠吃什么药效果好| 外阴溃烂用什么药| 什么东西最贵| 屁臭是什么原因造成的| 新生儿ad滴剂什么时候吃最好| 喝酒手掌发红是什么原因| 小孩咳嗽是什么原因引起的| 梦到妈妈怀孕什么预兆| 譬如是什么意思| mw是什么单位| 细菌感染吃什么药| 花椒水泡脚有什么好处| 女人烂桃花多说明什么| 花生和什么不能一起吃| 蛋白肉是什么东西做的| 缠足是什么时候开始的| 梦到自己生孩子了是什么预兆| 前白蛋白低是什么原因| c5是什么意思| 10.28是什么星座| 太监和宫女对食是什么意思| 眼神迷离什么意思| 氧氟沙星和诺氟沙星有什么区别| 一什么之什么成语| 敦伦是什么意思| 积德是什么意思| 靓女是什么意思| 三界是什么意思| 1955年是什么年| 喝茶喝多了有什么坏处| 社保缴费基数什么意思| 补气血吃什么食物最好| 寿诞是什么意思| 放线菌是什么| 欣赏是什么意思| 什么的水流| 什么米叫粳米| 动脉硬化吃什么| 出火是什么意思| 苏州五行属什么| 胃不舒服可以吃什么水果| 中出是什么| 八字不合是什么生肖| 尿量少是什么原因| 今年农历什么年| 缪斯女神什么意思| 巨蟹男和什么座最配对| 女人卵巢保养吃什么好| 犹太人是什么人种| 丝状疣是什么样子图片| 两胸中间疼是什么原因| 气滞血瘀吃什么食物好| 动态密码是什么意思| 下午4点半是什么时辰| 80岁称什么之年| 四不伤害是指什么| 尿渗透压低是什么原因| 茶氨酸是什么| 什么是心脏早搏| 分析是什么意思| 寮房是什么意思| 26周岁属什么| 12月是什么座| 吃什么会食物中毒| 漏斗胸是什么病| 阴道痛什么原因| helen是什么意思| 电视黑屏是什么原因| 子宫内膜厚是什么意思| 雨淋棺材有什么说法| 1946年属什么| lime是什么水果| 公顷是什么意思| 母螳螂为什么要吃公螳螂| 免疫比浊法是什么意思| 猪肉炒什么好吃| 朋友越来越少暗示什么| 吃什么养肝| 改姓需要什么手续| 甘油三酯高有什么症状| 手腕凸起的骨头叫什么| 猫咪拉稀吃什么药| 怀女儿有什么症状| 氟利昂是什么味道| 吃什么容易发胖| 末梢神经炎是什么症状| 今年是农历的什么年| 右手大拇指抖动是什么原因| 熟地黄有什么功效| 娣什么意思| 艾草长什么样| 只要睡觉就做梦是什么原因| 水烟是什么| 甚嚣尘上是什么意思| 莲子心和什么搭配泡水喝最好| 脚底起水泡是什么原因| 疲惫是什么意思| 上嘴唇上有痣代表什么| 中国最高军衔是什么| 掷是什么意思| 给老人买什么礼物| 走心是什么意思| 音欠读什么| 窦炎症是什么病| 百折不挠指什么生肖| 姐妹是什么意思| 睡醒口干口苦是什么原因| 18kgp是什么材质| en是什么意思| 霉菌阳性是什么意思| 讨扰是什么意思| 晴雨伞是什么意思| 爱做梦是什么原因| 孕妇吃什么鱼最好| 冰岛为什么不让随便去| vampire是什么意思| 什么老什么老| 拍身份证穿什么衣服| 锁骨上的痣代表什么| 子宫内膜双层什么意思| 什么是体外射精| 小便不利什么意思| 怡字属于五行属什么| 类风湿关节炎吃什么药| 尿血是什么病的征兆| 藜芦是什么| 舌头疼挂什么科| 中国国酒是什么| 过期的维生素c有什么用途| 医生会诊是什么意思| 导语是什么| 左下腹疼痛是什么原因女性| 不加热血清反应素试验是什么| galaxy是什么牌子| mrv是什么检查| 晚上头疼是什么原因| 什么容易误诊为水痘| 梦见老公出轨什么意思| 脑梗能吃什么| 代孕什么意思| 抗组胺药是什么意思| 囊肿挂什么科| 馒头配什么菜好吃| 夫妻肺片是什么| 尿比重高是什么原因| 血热吃什么药好得快| 内分泌科属于什么科| 梦见被蛇咬是什么意思| 孙悟空头上戴的是什么| eo是什么意思| 人各有命是什么意思| 二月底是什么星座| 三天没有大便是什么原因| 牙根疼吃什么药最好| 补锌吃什么药| 统战部是干什么的| 什么病会通过唾液传播| 为什么一同房就有炎症| 什么是幂| 熬夜有什么危害| national是什么牌子| 脖子肿了是什么原因| 黄体破裂什么症状| 什么是脑卒中| 大小周是什么意思| 梦见舅舅是什么意思| 嗜酸性粒细胞偏低是什么原因| 入殓师是做什么的| 大宝贝是什么意思| 百香果什么味道| 房间消毒杀菌用什么好| 属虎和什么属相最配| 经期吃什么缓解痛经| 参商是什么意思| 1972年是什么年| 怀孕从什么时候开始算起| 夜字五行属什么| 甲状旁腺激素高吃什么药| 精子不液化吃什么药| 女子是什么意思| 高锰酸钾是什么| 糖耐量受损是什么意思| 南乳是什么| 老过敏是缺什么维生素| 考药师证需要什么条件| 拔牙挂什么科室| 腔梗吃什么药| 女人小便疼是什么原因| 什么是种植牙| 大姨妈量少什么原因| 主动脉迂曲是什么意思| 狗改不了吃屎是什么意思| 94年是什么年| 结石吃什么药| 阉了是什么意思| 打鼾挂什么科| 腹部淋巴结肿大是什么原因| 晚上尿次数多什么原因| 12月16号是什么星座| 跖疣是什么样子图片| 当家作主是什么生肖| eob是什么意思| 寻常是什么意思| 肝藏血是什么意思| 泌尿外科看什么病| 刚怀孕吃什么水果对胎儿好| 眼睛近视缺什么维生素| 大校军衔是什么级别| 古驰属于什么档次| 孟字五行属什么| 脚痒用什么药膏最有效| 台湾以前叫什么名字| 散光是什么原因导致的| 膀胱炎看什么科| 36朵玫瑰花代表什么意思| 手指关节痛是什么原因| 1989年属蛇是什么命| 属狗的守护神是什么菩萨| 女人什么血型最聪明| 三点水加亘念什么| 挂钩疼挂什么科| 说风就是雨什么意思| 尿素氮高吃什么药| 主胰管不扩张是什么意思| 噗是什么意思| 出虚汗是什么原因引起的怎么调理| 胎盘低置状态是什么意思| 人为什么会生病| 长针眼是什么原因| 遥不可及什么意思| 什么是硬下疳| 小孩嗓子疼吃什么药| 1963年发生了什么| rose是什么意思| 百度

国产大飞机C919在上海完成首次跑道高速滑行测试


百度 截止2017年底,投服中心供持有沪深两市3443家上市公司每家100股票,向1521家上市公司累计行权1876次,发送股东建议函1472次,参加股东大会58次,现场查阅41次。

In addition to its built-in scalar types (Int, String, etc.), GraphQL supports defining custom scalars. For example, your schema might provide a custom scalar for Date, UUID, or GeoLocation.

Custom Scalars are initially defined as part of a schema. To interact with a schema using custom scalars, your client must define a Swift type to use for each custom scalar.

Apollo iOS automatically defines Swift types for all of the built-in scalar types:

GraphQL TypeSwift Type
IntInt
FloatDouble
BooleanBool
StringString
IDString

By default, each custom scalar is treated as a Swift String, but you can customize the type of all of your custom scalars with Apollo iOS!

Generating custom scalar types

If any part of your GraphQL application references a custom scalar defined by the schema, a file for it will be generated in your generated schema output. This file can be used to define the Swift type for the custom scalar.

For example, in a schema that defines a custom scalar:

GraphQL
MySchema.graphqls
1 scalar UUID

Apollo iOS generates a UUID custom scalar type in your generated schema output. This generated file defines UUID as a String by default.

Swift
MySchema/CustomScalars/UUID.swift
1public extension MySchema {
2  typealias UUID = String
3}

The MySchema.UUID type will be referenced in any other generated objects that reference the UUID scalar.

Because custom scalar files are only generated once, they can then be edited, and your changes will never be overwritten by subsequent code generation execution.

You can edit this file to define a different type for the UUID scalar type.

Note: Custom scalars may be referenced by fields on GraphQL types, values for input parameters, or on input objects. Because custom scalars are only generated when they are referenced by your operations, they may be added to your project during any future execution of code generation, not just on the initial execution.

Defining a custom scalar type

You can define the type for a custom scalar by creating a new type, or by pointing the typealias to another existing type.

The type for your custom scalar must conform to the CustomScalarType protocol. This requires you to implement the JSON serialization functionality for your custom scalar type.

To implement the CustomScalarType protocol:

1. Implement the _jsonValue property.

This converts the scalar value into a JSONValue that can be serialized into a JSON dictionary. The value of the _jsonValue property will be stored in the cache as the JSON value for the custom scalar.

Usually, this should be identical to the value received from the network response to represent the custom scalar.

2. Implement the init(_jsonValue:) initializer.

This initializer is used to construct the custom scalar value from a JSONValue. When constructing the scalar from a network response, the value of the _jsonValue parameter will be the value from the network response. When constructing the scalar from a cached value, this will be the value provided in the _jsonValue property.

If the value provided is unrecognized, you should throw an error from this function. Apollo iOS provides JSONDecodingError in the ApolloAPI library, but you may throw any custom error you wish.

3. Implement the Hashable and Equatable protocols if needed.

If your custom scalar type does not already conform to Hashable and Equatable, you will need to implement hash(into:) and the == operator to conform to each of these protocols respectively.

Example: UUID

For example, you could point the typealias for UUID to the Foundation.UUID type:

Swift
MySchema/CustomScalars/UUID.swift
1import Foundation
2
3public extension MySchema {
4  typealias UUID = Foundation.UUID
5}
6
7extension Foundation.UUID: CustomScalarType {
8  public init (_jsonValue value: JSONValue) throws {
9    guard let uuidString = value as? String,
10    let uuid = UUID(uuidString: uuidString) else {
11      throw JSONDecodingError.couldNotConvert(value: value, to: Foundation.UUID.self)
12    }
13
14    self = uuid
15  }
16
17  public var _jsonValue: JSONValue {
18    uuidString
19  }
20}

Example: GeoPoint

Alternatively, you could create your own custom scalar type. In this case, replace the typealias with the new type.

For example, a custom scalar GeoPoint that has a JSON representation of "100.0,10.0" could be implemented like this:

Swift
MySchema/CustomScalars/GeoPoint.swift
1import Foundation
2
3extension MySchema {
4    public struct GeoPoint: CustomScalarType, Hashable {
5        let x: Float
6        let y: Float
7
8        public init (_jsonValue value: JSONValue) throws {
9            let coordinates = try (value as? String)?
10            .components(separatedBy: ",")
11            .map { try Float(_jsonValue: $0) }
12
13            guard let coordinates, coordinates.count == 2 else {
14                throw JSONDecodingError.couldNotConvert(value: value, to: GeoPoint.self)
15            }
16
17            self.x = coordinates[0]
18            self.y = coordinates[1]
19        }
20
21        public var _jsonValue: JSONValue {
22            "\(String(format: "%.1f", x)),\(String(format: "%.1f", y))"
23        }
24    }
25}

The GeoPoint struct conforms to both CustomScalarType and Hashable. You must explicitly declare the conformance to Hashable, which inherits Equatable conformance. Because Swift can synthesize the Hashable and Equatable conformancs here, you do not need to implement them.

The init(_jsonValue:) initializer casts the JSONValue as a String and separates it into two coordinates. It converts those coordinates using Float(_jsonValue:) which is provided by Apollo. Each of the built-in scalar types has JSON serialization support that you can use within your custom scalar implementations.

To ensure consistency of the serialized JSON, the _jsonValue function ensures that the coordinates are formatted with a single decimal point using String(format:,_:).

JSON and other custom scalars with multiple return types

Some custom scalars are set up to potentially return multiple types at runtime. This is not ideal since you lose type safety, but if you're using an API you don't have control over, there's often not a great alternative to this.

When this happens, because you don't know the type that's coming in, you can't set up a single typealias for that scalar. Instead, you need to define some other way of instantiating your custom scalar object.

This happens most often with JSON, which can return either an array or a dictionary. Here's an example of how you can use an enum to allow dynamic-but-limited types to parse (with CustomJSON as a placeholder type name`):

Swift
MySchema/CustomScalars/CustomJSON.swift
1extension MySchema {
2    public enum CustomJSON: CustomScalarType, Hashable {
3        case dictionary([String: AnyHashable])
4        case array([AnyHashable])
5
6        public init(_jsonValue value: JSONValue) throws {
7            if let dict = value as? [String: AnyHashable] {
8                self = .dictionary(dict)
9            } else if let array = value as? [AnyHashable] {
10                self = .array(array)
11            } else {
12                throw JSONDecodingError.couldNotConvert(value: value, to: CustomJSON.self)
13            }
14        }
15
16        public var _jsonValue: JSONValue {
17            switch self {
18            case let .dictionary(json as AnyHashable),
19                 let .array(json as AnyHashable):
20                return json
21            }
22        }
23
24        public static func == (lhs: CustomJSON, rhs: CustomJSON) -> Bool {
25            lhs._jsonValue == rhs._jsonValue
26        }
27
28        public func hash(into hasher: inout Hasher) {
29            hasher.combine(_jsonValue)
30        }
31    }
32}
汧是什么意思 女性口苦是什么原因引起的 的意思是什么 搭桥和支架有什么区别 吃什么伤口愈合的快
千千结是什么意思 e抗原阳性是什么意思 18岁是什么生肖 什么是otc 啖是什么意思
过敏性结膜炎用什么眼药水 霸王别姬是什么菜 金丝皇菊有什么功效 肛门跳动是什么原因 乙肝三项检查什么
为什么乳头会有白色分泌物 什么是粳米 视力模糊什么原因 安道尔微信暗示什么 甲亢有什么反应
口坐念什么jasonfriends.com 柠檬水喝多了有什么坏处hcv9jop1ns3r.cn 心宽是什么意思bfb118.com 妒忌是什么意思hcv8jop5ns7r.cn 弹颏是什么意思hcv8jop7ns6r.cn
戏子是什么意思hcv8jop3ns0r.cn 黄精是什么药材hcv8jop4ns7r.cn 不什么其什么hcv8jop7ns2r.cn 阴道为什么会排气hcv8jop4ns7r.cn 千千结是什么意思dajiketang.com
县委办公室主任是什么级别hcv7jop6ns8r.cn 梦到别人怀孕了是什么意思hcv9jop3ns9r.cn 心服口服是什么意思hcv7jop9ns8r.cn 晚饭后散步有什么好处hcv9jop6ns2r.cn 1961年属什么hcv8jop7ns3r.cn
白细胞低要吃什么hcv9jop6ns1r.cn 不安腿综合征吃什么药hcv9jop7ns0r.cn rta是什么意思hcv8jop0ns4r.cn 大姨妈很多血块是什么原因hcv7jop7ns0r.cn 用什么药膏能拔去粉瘤hcv9jop3ns4r.cn
百度