Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Apollo_Code_Generation [jp]

YuyaHorita
October 09, 2019

Apollo_Code_Generation [jp]

YuyaHorita

October 09, 2019
Tweet

More Decks by YuyaHorita

Other Decks in Programming

Transcript

  1. Introduction ງా ༗࠸ iOS Engineer @CyberAgent, 2017/4 ~ 2019/5 Software

    Engineer @M3, 2019/5 ~ GitHub: https://github.com/horita-yuya Twitter: https://twitter.com/horita_yuya Medium: https://medium.com/@yuyaHorita
  2. User.graphql Tokens query User ( $ id email @ include

    … AddressFragment Debug : response ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~
  3. query User ( $ @ … AddressFragment NAME Kind Value

    undefined undefined undefined undefined COMMENT Debug Parse࣌ʹແࢹ͞ΕΔ name : undefined
  4. Document Hoge parseॲཧ function parseHoge ͷ໊લͰgraphql/language/parser.jsʹఆٛ = OperationDefinition OperationType Name

    VariableDefinitions VariableDefinition SelectionSet VariableDefinition ࠶ؼԼ߱ߏจղੳ
  5. Type Variable Name value: id Name value: Int! VariableDefinitions VariableDefinition

    VariableDefinition Type Variable Name value: withEmail Name value: Boolean!
  6. VariableDefinitions VariableDefinition VariableDefinition + schema.json GraphQLType GraphQLType Type Variable Name

    value: id Name value: Int! Type Variable Name value: withEmail Name value: Boolean!
  7. IR

  8. Summary 1. *.graphql͔ΒASTΛੜ੒ 2. schema.jsonͱরΒ͠߹Θͤͳ͕ΒɺAST͔ΒIRΛੜ੒ 3. IR͔Βɺ.swift, .ts, .scalaΛੜ੒ (

    scala͸LegacyͷํΛ࢖͍ͬͯΔ ) 4. .kt͸apollo-toolingΛ࢖Θͣɺapollo-androidͰผ࣮૷?