Skip to content

v0.7.1

Compare
Choose a tag to compare
@OlegIlyenko OlegIlyenko released this 02 Jul 13:37
· 1765 commits to main since this release
  • Provide extendSchema utility function (#113). This feature allows you to extend existing schema with additional types and existing types with additional fields. It may be very useful for client-side tools and for server implementations in cases where parts of a schema are dynamically generated or coming from external sources (like database).

    Here is a small example of how you can use it:

    val schema: Schema[Ctx, Val] = Schema(...)
    
    val schemaExtensions =
      graphql"""
        extend type Human {
          pet: Animal @loadPetInfo
        }
    
        interface Animal {
          name: String!
        }
    
        type Dog implements Animal {
          name: String!
          nickname: String
        }
    
        type Cat implements Animal {
          name: String!
          age: Int
        }
      """
    
    val myCustomBuilder = new DefaultAstSchemaBuilder[Ctx] {...}
    
    val extendedSchema = 
      schema.extend(schemaExtensions, myCustomBuilder)  

    Just like with AST-based schema materialization, you can provide a custom schema builder which allows you to control most of the aspects of generated parts of the schema.

  • Handling of more than one ProjectionName for one field (#146).

  • Updated context propagated only to siblings (#145).