sangria v0.7.1 Release Notes

Release Date: 2016-07-02 // almost 8 years ago
    • 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).