String
UTF-8 character sequence scalar type
Audience: Programmer
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Format
UTF-8 encoded text
No length limit (unless specified by field)
Supports all Unicode characters
Empty strings are valid
Usage
type Customer {
id: ID!
name: String!
description: String # Nullable
code: String!
}
mutation {
createCustomer(input: {
name: "Acme Corporation"
code: "ACME-001"
description: "Primary supplier for widgets"
}) {
customer {
id
}
}
}Common String Fields
Names and titles
Descriptions and comments
Codes and SKUs
URLs and paths
JSON strings (for Map fields)
Filtering
String fields often support these filters:
field_CONTAINS- Substring matchfield_STARTS_WITH- Prefix matchfield_ENDS_WITH- Suffix matchfield_IN- Match any of the valuesfield_NOT- Negation
See Also
Input Types - String-based filters
Map - JSON data as strings
Last updated
Was this helpful?
