-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
fragment
fragment SellingProductListFragmentContainer_store_representActiveProducts on Store
@argumentDefinitions(
count: { type: "Int", defaultValue: 10 }
cursor: { type: "ID" }
filter: { type: "ProductFilter", defaultValue: { statuses: [ACTIVE], representStatus: ACTIVE } }
)
@refetchable(queryName: "SellingProductListFragmentContatinerRepresentActiveProducts") {
representActiveProducts: products(first: $count, after: $cursor, filter: $filter)
@connection(key: "SellingProductListFragmentContainer_store_representActiveProducts") {
edges {
node {
_id
}
}
}
}
When the relay-compiler command is executed, generated the hash value is
This result is presumably due to this code working.
https://github.com/facebook/relay/blob/c0cc17a07e1f0c01f3e5c564eed50b5a30f4228f/compiler/crates/relay-compiler/src/build_project/build_ir.rs
but when i execute same fragment in this code it return different hash value
const { parse, print } = require('graphql')
const crypto = require('node:crypto')
const gql = String.raw
const text = gql`
fragment SellingProductListFragmentContainer_store_representActiveProducts on Store
@argumentDefinitions(
count: { type: "Int", defaultValue: 10 }
cursor: { type: "ID" }
filter: { type: "ProductFilter", defaultValue: { statuses: [ACTIVE], representStatus: ACTIVE } }
)
@refetchable(queryName: "SellingProductListFragmentContatinerRepresentActiveProducts") {
representActiveProducts: products(first: $count, after: $cursor, filter: $filter)
@connection(key: "SellingProductListFragmentContainer_store_representActiveProducts") {
edges {
node {
_id
}
}
}
}
`
const ast = parse(text)
const definition = ast.definitions[0]
const printed = print(definition)
const hash = crypto.createHash('md5').update(printed, 'utf8').digest('hex')
console.log(hash)
the hash value is
296c46ae6772194c8404c631edebccbf
I put the same input into the md5 hash function, but why are the results different?
noghartt
Metadata
Metadata
Assignees
Labels
No labels